summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2018-02-21 01:10:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2018-02-21 01:10:33 +0000
commitcb77b79fd077288bb8433e0d46000542279cdf8e (patch)
treeb80e91801aefd0f530a024c6de1dd988f5aab15b
parent1ef5b6fab49ee39db99e7b98ed08c9c10db5b526 (diff)
parentdb2734ca2b10d6fecc5fc211862180a79435f708 (diff)
Merge "Prevent quickscrub when swipe up has already started"
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java10
2 files changed, 11 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
index 4454ef9f411c..57d78ddde4dc 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java
@@ -88,7 +88,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
@Override
public void onRecentsAnimationStarted() {
mRecentsAnimationStarted = true;
- mQuickScrubController.cancelQuickSwitch();
+ mQuickScrubController.setRecentsAnimationStarted(true /* started */);
}
};
@@ -163,6 +163,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
mNavigationBarView.transformMatrixToGlobal(mTransformGlobalMatrix);
mNavigationBarView.transformMatrixToLocal(mTransformLocalMatrix);
mRecentsAnimationStarted = false;
+ mQuickScrubController.setRecentsAnimationStarted(false /* started */);
break;
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java
index 378858a9b816..dc0ea1cba653 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java
@@ -75,6 +75,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
private boolean mDraggingActive;
private boolean mQuickScrubActive;
private boolean mAllowQuickSwitch;
+ private boolean mRecentsAnimationStarted;
private float mDownOffset;
private float mTranslation;
private int mTouchDownX;
@@ -279,7 +280,7 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
}
// Control the button movement
- if (!mDraggingActive && exceededTouchSlop) {
+ if (!mDraggingActive && exceededTouchSlop && !mRecentsAnimationStarted) {
boolean allowDrag = !mDragPositive
? offset < 0 && pos < touchDown : offset >= 0 && pos > touchDown;
if (allowDrag) {
@@ -417,6 +418,13 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
mDraggingActive = false;
}
+ public void setRecentsAnimationStarted(boolean started) {
+ mRecentsAnimationStarted = started;
+ if (started) {
+ cancelQuickSwitch();
+ }
+ }
+
public void cancelQuickSwitch() {
mAllowQuickSwitch = false;
mHandler.removeCallbacks(mLongPressRunnable);