Skip to content

Commit c7b1217

Browse files
romanbbcodex-corp
authored andcommitted
SystemUI: improve one finger notification expansion
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
1 parent 6e7625c commit c7b1217

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

packages/SystemUI/src/com/android/systemui/ExpandHelper.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public interface Callback {
7676
private int mExpansionStyle = NONE;
7777
private boolean mWatchingForPull;
7878
private boolean mHasPopped;
79+
private boolean mForcedOneFinger;
7980
private View mEventSource;
8081
private View mCurrView;
8182
private View mCurrViewTopGlow;
@@ -304,6 +305,10 @@ public void setScrollView(View scrollView) {
304305
mScrollView = scrollView;
305306
}
306307

308+
public void setForceOneFinger(boolean forceOneFinger) {
309+
mForcedOneFinger = forceOneFinger;
310+
}
311+
307312
private float calculateGlow(float target, float actual) {
308313
// glow if overscale
309314
if (DEBUG_GLOW) Log.d(TAG, "target: " + target + " actual: " + actual);
@@ -407,7 +412,7 @@ public boolean onInterceptTouchEvent(MotionEvent ev) {
407412

408413
case MotionEvent.ACTION_DOWN:
409414
final boolean inside = isInside(mScrollView, x, y);
410-
mWatchingForPull = isInside(mScrollView, x, y);
415+
mWatchingForPull = (inside || mForcedOneFinger);
411416
mLastMotionY = y;
412417
if (inside) {
413418
mInitialTouchY = y;
@@ -528,6 +533,10 @@ private void startExpanding(View v, int expandType) {
528533
}
529534
}
530535

536+
public float getNaturalHeight() {
537+
return mNaturalHeight;
538+
}
539+
531540
private void finishExpanding(boolean force) {
532541
if (!mExpanding) return;
533542

0 commit comments

Comments
 (0)