From 734be27f9b2a63bfa7fc33d6488993a4811ced9c Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 28 Aug 2020 13:23:10 -0700 Subject: [PATCH] Intercept touch events from anywhere while all apps is closing Previously we did this only from a settled state, but now we also do it during the transition to NORMAL. Test: open all apps. Then, swipe down to home and back up to all apps (from above the top of all apps). Fixes: 159856104 Change-Id: Ib78c6a41d5fa17dd26a7df4e9069e0ada1f46dd0 --- .../touchcontrollers/PortraitStatesTouchController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index 1208c6c79b..059a703075 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -89,13 +89,16 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr @Override protected boolean canInterceptTouch(MotionEvent ev) { + // If we are swiping to all apps instead of overview, allow it from anywhere. + boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview; if (mCurrentAnimation != null) { if (mFinishFastOnSecondTouch) { mCurrentAnimation.getAnimationPlayer().end(); } AllAppsTransitionController allAppsController = mLauncher.getAllAppsController(); - if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()) { + if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress() + || interceptAnywhere) { // If we are already animating from a previous state, we can intercept as long as // the touch is below the current all apps progress (to allow for double swipe). return true; @@ -117,9 +120,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr return false; } } else { - // If we are swiping to all apps instead of overview, allow it from anywhere. - boolean interceptAnywhere = mLauncher.isInState(NORMAL) && !mAllowDragToOverview; - // For all other states, only listen if the event originated below the hotseat height + // For non-normal states, only listen if the event originated below the hotseat height if (!interceptAnywhere && !isTouchOverHotseat(mLauncher, ev)) { return false; }