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
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java
index 1208c6c..059a703 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 @@
@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 @@
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;
}