Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 272ecdce authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge QP1A.191005.007 into master

Bug: 142297020
Change-Id: I8ee6a4e97c145226a5a943a0882925c8c9525c81
parents 636e5842 ecb12313
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -926,18 +926,19 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
                                : LAST_TASK;
            }
        } else {
            if (mMode == Mode.NO_BUTTON && endVelocity < 0 && !mIsShelfPeeking) {
            // If swiping at a diagonal, base end target on the faster velocity.
                endTarget = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity)
                        ? NEW_TASK : HOME;
            } else if (endVelocity < 0) {
                if (reachedOverviewThreshold) {
                    endTarget = RECENTS;
                } else {
            boolean isSwipeUp = endVelocity < 0;
            boolean willGoToNewTaskOnSwipeUp =
                    goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity);

            if (mMode == Mode.NO_BUTTON && isSwipeUp && !willGoToNewTaskOnSwipeUp) {
                endTarget = HOME;
            } else if (mMode == Mode.NO_BUTTON && isSwipeUp && !mIsShelfPeeking) {
                // If swiping at a diagonal, base end target on the faster velocity.
                    endTarget = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity)
                endTarget = NEW_TASK;
            } else if (isSwipeUp) {
                endTarget = !reachedOverviewThreshold && willGoToNewTaskOnSwipeUp
                        ? NEW_TASK : RECENTS;
                }
            } else {
                endTarget = goingToNewTask ? NEW_TASK : LAST_TASK;
            }