summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matthew Ng <ngmatthew@google.com> 2018-01-17 15:32:41 -0800
committer Matthew Ng <ngmatthew@google.com> 2018-01-17 16:31:08 -0800
commite0903c9f059e223fd1522d16eb38d9a06fca8fe0 (patch)
tree334d0d356c7cefdedef279004d1ae9c0564a5a1a
parente2861da8ef0eba65c1bb9d5f67380884e2ead939 (diff)
Prevent quick scrub when dragging up
When leaving the touch slop in the perpendicular direction of quick scrub, remove the timeout to start quickscrub so launcher can continue to handle touch events. Bug: 67957962 Bug: 70180755 Test: manual - drag up with quick step enabled Change-Id: Icb5fcd992b17ac05402b83543115e6ab34475d2f
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java16
1 files changed, 13 insertions, 3 deletions
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 9f8a7efa04f3..484d8837de08 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickScrubController.java
@@ -207,21 +207,31 @@ public class QuickScrubController extends GestureDetector.SimpleOnGestureListene
int y = (int) event.getY();
int xDiff = Math.abs(x - mTouchDownX);
int yDiff = Math.abs(y - mTouchDownY);
- boolean exceededTouchSlop;
+ boolean exceededTouchSlopX = xDiff > mScrollTouchSlop && xDiff > yDiff;
+ boolean exceededTouchSlopY = yDiff > mScrollTouchSlop && yDiff > xDiff;
+ boolean exceededTouchSlop, exceededPerpendicularTouchSlop;
int pos, touchDown, offset, trackSize;
+
if (mIsVertical) {
- exceededTouchSlop = yDiff > mScrollTouchSlop && yDiff > xDiff;
+ exceededTouchSlop = exceededTouchSlopY;
+ exceededPerpendicularTouchSlop = exceededTouchSlopX;
pos = y;
touchDown = mTouchDownY;
offset = pos - mTrackRect.top;
trackSize = mTrackRect.height();
} else {
- exceededTouchSlop = xDiff > mScrollTouchSlop && xDiff > yDiff;
+ exceededTouchSlop = exceededTouchSlopX;
+ exceededPerpendicularTouchSlop = exceededTouchSlopY;
pos = x;
touchDown = mTouchDownX;
offset = pos - mTrackRect.left;
trackSize = mTrackRect.width();
}
+ // Do not start scrubbing when dragging in the perpendicular direction
+ if (!mDraggingActive && exceededPerpendicularTouchSlop) {
+ mHandler.removeCallbacksAndMessages(null);
+ return false;
+ }
if (!mDragPositive) {
offset -= mIsVertical ? mTrackRect.height() : mTrackRect.width();
}