[automerger] Fix thresholds with deferred-start swipe up gestures am: fdf9315b8e
Change-Id: I569db435a37733be47e278fa6fd465f024c625a3
diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
index 2d41a5b..d1003a5 100644
--- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
+++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java
@@ -82,7 +82,10 @@
private final PointF mLastPos = new PointF();
private int mActivePointerId = INVALID_POINTER_ID;
private boolean mPassedInitialSlop;
+ // Used for non-deferred gestures to determine when to start dragging
private int mQuickStepDragSlop;
+ // Used for deferred gestures to determine both start of animation and dragging
+ private int mQuickStepTouchSlop;
private float mStartDisplacement;
private WindowTransformSwipeHandler mInteractionHandler;
private int mDisplayRotation;
@@ -128,6 +131,7 @@
mLastPos.set(mDownPos);
mPassedInitialSlop = false;
mQuickStepDragSlop = NavigationBarCompat.getQuickStepDragSlopPx();
+ mQuickStepTouchSlop = NavigationBarCompat.getQuickStepTouchSlopPx();
// Start the window animation on down to give more time for launcher to draw if the
// user didn't start the gesture over the back button
@@ -160,15 +164,22 @@
}
mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex));
float displacement = getDisplacement(ev);
- if (!mPassedInitialSlop
- && Math.abs(displacement) > mQuickStepDragSlop) {
- mPassedInitialSlop = true;
- mStartDisplacement = displacement;
-
- // If we deferred starting the window animation on touch down, then
- // start tracking now
+ if (!mPassedInitialSlop) {
if (mIsDeferredDownTarget) {
- startTouchTrackingForWindowAnimation(ev.getEventTime());
+ // Deferred gesture, start the animation and gesture tracking once we pass
+ // the touch slop
+ if (Math.abs(displacement) > mQuickStepTouchSlop) {
+ startTouchTrackingForWindowAnimation(ev.getEventTime());
+ mPassedInitialSlop = true;
+ mStartDisplacement = displacement;
+ }
+ } else {
+ // Normal gesture, ensure we pass the drag slop before we start tracking
+ // the gesture
+ if (Math.abs(displacement) > mQuickStepDragSlop) {
+ mPassedInitialSlop = true;
+ mStartDisplacement = displacement;
+ }
}
}