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
diff --git a/src/com/android/launcher3/touch/WorkspaceTouchListener.java b/src/com/android/launcher3/touch/WorkspaceTouchListener.java
index 20d2ad3..93387ad 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_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 @@
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;
}