diff --git a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java index 2d41a5bf6c..d1003a51c3 100644 --- a/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java +++ b/quickstep/src/com/android/quickstep/OtherActivityTouchConsumer.java @@ -82,7 +82,10 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC 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 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC 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 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC } 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; + } } }