summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-08-15 01:39:36 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-15 01:39:36 (GMT)
commitecb12313bfd83b64876468f7a1cfda5763c13734 (patch)
tree5ed13f83178186fb29afce752b6c6d78a2ab623a
parentc87bbeea6bc6c693af9bf8648cdd6f777c9a46e6 (diff)
parentb39a166018f1e4495ba5071bcd5cdb9eba951b47 (diff)
downloadandroid_packages_apps_Trebuchet-ecb12313bfd83b64876468f7a1cfda5763c13734.zip
android_packages_apps_Trebuchet-ecb12313bfd83b64876468f7a1cfda5763c13734.tar.gz
android_packages_apps_Trebuchet-ecb12313bfd83b64876468f7a1cfda5763c13734.tar.bz2
Merge cherrypicks of [9201404] into qt-release
Change-Id: Ie491575f45eb7885eb00854f7e28657d0a783e08
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index 476bb8f..f790c40 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -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.
+ 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)
- ? NEW_TASK : HOME;
- } else if (endVelocity < 0) {
- if (reachedOverviewThreshold) {
- endTarget = RECENTS;
- } else {
- // If swiping at a diagonal, base end target on the faster velocity.
- endTarget = goingToNewTask && Math.abs(velocity.x) > Math.abs(endVelocity)
- ? NEW_TASK : RECENTS;
- }
+ endTarget = NEW_TASK;
+ } else if (isSwipeUp) {
+ endTarget = !reachedOverviewThreshold && willGoToNewTaskOnSwipeUp
+ ? NEW_TASK : RECENTS;
} else {
endTarget = goingToNewTask ? NEW_TASK : LAST_TASK;
}