From ff20eae383e40058bed5bb9c05d668982670bcd5 Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Wed, 19 Aug 2020 17:21:53 -0700 Subject: [PATCH] Allow swipe up to go home from overivew during task dismiss animation Test: go to overview, dismiss a task, swipe up to go home during the transition (easier to try with animation duraation scaled up) Bug: 144170434 Change-Id: I28b846b43260179aeac877351a7069743f66f3ea Merged-In: I28b846b43260179aeac877351a7069743f66f3ea --- .../touchcontrollers/TaskViewTouchController.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index 7bae2e5d86..2cfbc2bec6 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -83,7 +83,15 @@ public abstract class TaskViewTouchController mDetector = new SingleAxisSwipeDetector(activity, this, dir); } - private boolean canInterceptTouch() { + private boolean canInterceptTouch(MotionEvent ev) { + if ((ev.getEdgeFlags() & Utilities.EDGE_NAV_BAR) != 0) { + // Don't intercept swipes on the nav bar, as user might be trying to go home + // during a task dismiss animation. + if (mCurrentAnimation != null) { + mCurrentAnimation.getAnimationPlayer().end(); + } + return false; + } if (mCurrentAnimation != null) { mCurrentAnimation.forceFinishIfCloseToEnd(); } @@ -119,7 +127,7 @@ public abstract class TaskViewTouchController clearState(); } if (ev.getAction() == MotionEvent.ACTION_DOWN) { - mNoIntercept = !canInterceptTouch(); + mNoIntercept = !canInterceptTouch(ev); if (mNoIntercept) { return false; }