Skip to content

Commit

Permalink
SystemUI: improve one finger notification expansion
Browse files Browse the repository at this point in the history
added missing setForceOneFinger method

Sometimes the quick settings ribbon would eat the initial ACTION_DOWN
setting mInitialTouchY in the expand helper, but we are clearly not in a
notification that we can expand here. So only set the initial y point if
we are inside the notification scrollview.

Change-Id: I628553ac15cc6b4ee3c682fe46bd1d96c6bc154d

Conflicts:
	packages/SystemUI/src/com/android/systemui/ExpandHelper.java
  • Loading branch information
romanbb authored and codex-corp committed Sep 5, 2014
1 parent 6e7625c commit c7b1217
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/SystemUI/src/com/android/systemui/ExpandHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public interface Callback {
private int mExpansionStyle = NONE;
private boolean mWatchingForPull;
private boolean mHasPopped;
private boolean mForcedOneFinger;
private View mEventSource;
private View mCurrView;
private View mCurrViewTopGlow;
Expand Down Expand Up @@ -304,6 +305,10 @@ public void setScrollView(View scrollView) {
mScrollView = scrollView;
}

public void setForceOneFinger(boolean forceOneFinger) {
mForcedOneFinger = forceOneFinger;
}

private float calculateGlow(float target, float actual) {
// glow if overscale
if (DEBUG_GLOW) Log.d(TAG, "target: " + target + " actual: " + actual);
Expand Down Expand Up @@ -407,7 +412,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {

case MotionEvent.ACTION_DOWN:
final boolean inside = isInside(mScrollView, x, y);
mWatchingForPull = isInside(mScrollView, x, y);
mWatchingForPull = (inside || mForcedOneFinger);
mLastMotionY = y;
if (inside) {
mInitialTouchY = y;
Expand Down Expand Up @@ -528,6 +533,10 @@ private void startExpanding(View v, int expandType) {
}
}

public float getNaturalHeight() {
return mNaturalHeight;
}

private void finishExpanding(boolean force) {
if (!mExpanding) return;

Expand Down

0 comments on commit c7b1217

Please sign in to comment.