From 8a10e63be72627546bdf73d514a2871c1c68d1f0 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Thu, 27 Jan 2022 13:18:36 +0000 Subject: [PATCH] Dismiss AllApps when scrim is clicked Bug: 208599118 Test: In tablet, clicking scrim dismisses AllApps bottom sheet. Scrolling AllApps won't dismiss the bottom sheet. Test: In non-tablet, clicking scrim do nothing. Test: Workspace touch isn't affected Change-Id: Ia93c6573efa8577c41251ddec56a8f75f1df32d0 --- src/com/android/launcher3/touch/WorkspaceTouchListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java index 20d2ad36a5..93387adb13 100644 --- a/src/com/android/launcher3/touch/WorkspaceTouchListener.java +++ b/src/com/android/launcher3/touch/WorkspaceTouchListener.java @@ -21,6 +21,7 @@ import static android.view.MotionEvent.ACTION_MOVE; import static android.view.MotionEvent.ACTION_POINTER_UP; import static android.view.MotionEvent.ACTION_UP; +import static com.android.launcher3.LauncherState.ALL_APPS; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORKSPACE_LONGPRESS; @@ -150,6 +151,11 @@ 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) { + mLauncher.getStateManager().goToState(NORMAL); + } return result; }