Loading quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +15 −3 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC private boolean mPassedWindowMoveSlop; // Slop used to determine when we say that the gesture has started. private boolean mPassedPilferInputSlop; // Same as mPassedPilferInputSlop, except when continuing a gesture mPassedPilferInputSlop is // initially true while this one is false. private boolean mPassedSlopOnThisGesture; // Might be displacement in X or Y, depending on the direction we are swiping from the nav bar. private float mStartDisplacement; Loading Loading @@ -244,6 +247,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex)); float displacement = getDisplacement(ev); float displacementX = mLastPos.x - mDownPos.x; float displacementY = mLastPos.y - mDownPos.y; if (!mPassedWindowMoveSlop) { if (!mIsDeferredDownTarget) { Loading @@ -258,11 +262,18 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC float horizontalDist = Math.abs(displacementX); float upDist = -displacement; boolean isLikelyToStartNewTask = horizontalDist > upDist; boolean passedSlop = squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop; if (!mPassedSlopOnThisGesture && passedSlop) { mPassedSlopOnThisGesture = true; } // Until passing slop, we don't know what direction we're going, so assume we might // be quick switching to avoid translating recents away when continuing the gesture. boolean isLikelyToStartNewTask = !mPassedSlopOnThisGesture || horizontalDist > upDist; if (!mPassedPilferInputSlop) { float displacementY = mLastPos.y - mDownPos.y; if (squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop) { if (passedSlop) { if (mDisableHorizontalSwipe && Math.abs(displacementX) > Math.abs(displacementY)) { // Horizontal gesture is not allowed in this region Loading Loading @@ -339,6 +350,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(mGestureState); mActiveCallbacks.addListener(mInteractionHandler); mTaskAnimationManager.notifyRecentsAnimationState(mInteractionHandler); mInteractionHandler.setIsLikelyToStartNewTask(true); notifyGestureStarted(); } else { intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId()); Loading quickstep/src/com/android/quickstep/GestureState.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL NEW_TASK(false, ContainerType.APP, true), LAST_TASK(false, ContainerType.APP, false); LAST_TASK(false, ContainerType.APP, true); GestureEndTarget(boolean isLauncher, int containerType, boolean recentsAttachedToAppWindow) { Loading Loading
quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +15 −3 Original line number Diff line number Diff line Loading @@ -112,6 +112,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC private boolean mPassedWindowMoveSlop; // Slop used to determine when we say that the gesture has started. private boolean mPassedPilferInputSlop; // Same as mPassedPilferInputSlop, except when continuing a gesture mPassedPilferInputSlop is // initially true while this one is false. private boolean mPassedSlopOnThisGesture; // Might be displacement in X or Y, depending on the direction we are swiping from the nav bar. private float mStartDisplacement; Loading Loading @@ -244,6 +247,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mLastPos.set(ev.getX(pointerIndex), ev.getY(pointerIndex)); float displacement = getDisplacement(ev); float displacementX = mLastPos.x - mDownPos.x; float displacementY = mLastPos.y - mDownPos.y; if (!mPassedWindowMoveSlop) { if (!mIsDeferredDownTarget) { Loading @@ -258,11 +262,18 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC float horizontalDist = Math.abs(displacementX); float upDist = -displacement; boolean isLikelyToStartNewTask = horizontalDist > upDist; boolean passedSlop = squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop; if (!mPassedSlopOnThisGesture && passedSlop) { mPassedSlopOnThisGesture = true; } // Until passing slop, we don't know what direction we're going, so assume we might // be quick switching to avoid translating recents away when continuing the gesture. boolean isLikelyToStartNewTask = !mPassedSlopOnThisGesture || horizontalDist > upDist; if (!mPassedPilferInputSlop) { float displacementY = mLastPos.y - mDownPos.y; if (squaredHypot(displacementX, displacementY) >= mSquaredTouchSlop) { if (passedSlop) { if (mDisableHorizontalSwipe && Math.abs(displacementX) > Math.abs(displacementY)) { // Horizontal gesture is not allowed in this region Loading Loading @@ -339,6 +350,7 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(mGestureState); mActiveCallbacks.addListener(mInteractionHandler); mTaskAnimationManager.notifyRecentsAnimationState(mInteractionHandler); mInteractionHandler.setIsLikelyToStartNewTask(true); notifyGestureStarted(); } else { intent.putExtra(INTENT_EXTRA_LOG_TRACE_ID, mGestureState.getGestureId()); Loading
quickstep/src/com/android/quickstep/GestureState.java +1 −1 Original line number Diff line number Diff line Loading @@ -48,7 +48,7 @@ public class GestureState implements RecentsAnimationCallbacks.RecentsAnimationL NEW_TASK(false, ContainerType.APP, true), LAST_TASK(false, ContainerType.APP, false); LAST_TASK(false, ContainerType.APP, true); GestureEndTarget(boolean isLauncher, int containerType, boolean recentsAttachedToAppWindow) { Loading