From 031a77022b5076302b0404e4309f36f031369b97 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 1 Mar 2022 20:00:36 +0000 Subject: [PATCH] Intercept workspace touch when Launcher is in AllApps bottom sheet Fix: 217571715 Test: Can't scroll workspace when AllApps bottomsheet is up Test: Can still scroll AllApps bottomsheet down Change-Id: I116f082ec6a6892cf5c7d0e1388a5771e6fdc4a6 --- .../launcher3/touch/WorkspaceTouchListener.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java index e8941e6969..fe0bf6d632 100644 --- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java +++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java @@ -121,6 +121,9 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe mLongPressState = STATE_COMPLETED; } + boolean isInAllAppsBottomSheet = mLauncher.isInState(ALL_APPS) + && mLauncher.getDeviceProfile().isTablet; + final boolean result; if (mLongPressState == STATE_COMPLETED) { // We have handled the touch, so workspace does not need to know anything anymore. @@ -136,8 +139,9 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe result = true; } else { - // We don't want to handle touch, let workspace handle it as usual. - result = false; + // We don't want to handle touch unless we're in AllApps bottom sheet, let workspace + // handle it as usual. + result = isInAllAppsBottomSheet; } if (action == ACTION_UP || action == ACTION_POINTER_UP) { @@ -153,9 +157,7 @@ public class WorkspaceTouchListener extends GestureDetector.SimpleOnGestureListe if (action == ACTION_UP || action == ACTION_CANCEL) { cancelLongPress(); } - if (action == ACTION_UP - && mLauncher.isInState(ALL_APPS) - && mLauncher.getDeviceProfile().isTablet) { + if (action == ACTION_UP && isInAllAppsBottomSheet) { mLauncher.getStateManager().goToState(NORMAL); mLauncher.getStatsLogManager().logger() .withSrcState(ALL_APPS.statsLogOrdinal)