From 0a9c092c89f4be3c5d59eef26aaffd2025e3e387 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 20 Sep 2016 22:50:06 -0700 Subject: Fixing two critical bugs in all apps transition controller bug#1: if long press from page indicator region, you can pull up all apps even though the workspace is in overview state. bug#2: all apps should not intercept touch not only in overview mode but also in any modal state. Change-Id: I91c0a181f037f6c2465a983825da3a2da7e2920f --- src/com/android/launcher3/Launcher.java | 4 +++- src/com/android/launcher3/allapps/AllAppsTransitionController.java | 7 +++---- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 81c95e7ed..1caec339b 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -3235,7 +3235,6 @@ public class Launcher extends Activity mWorkspace.startReordering(v); } else { showOverviewMode(true); - mHotseat.requestDisallowInterceptTouchEvent(true); } } else { final boolean isAllAppsButton = @@ -3386,6 +3385,9 @@ public class Launcher extends Activity mStateTransitionAnimation.startAnimationToWorkspace(mState, mWorkspace.getState(), Workspace.State.OVERVIEW, animated, postAnimRunnable); mState = State.WORKSPACE; + // If animated from long press, then don't allow any of the controller in the drag + // layer to intercept any remaining touch. + mWorkspace.requestDisallowInterceptTouchEvent(animated); } /** diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index 588823051..41d639379 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -108,7 +108,7 @@ public class AllAppsTransitionController implements TouchController, VerticalPul public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { mNoIntercept = false; - if (mLauncher.getWorkspace().isInOverviewMode() || mLauncher.isWidgetsViewVisible()) { + if (!mLauncher.isAllAppsVisible() && mLauncher.getWorkspace().workspaceInModalState()) { mNoIntercept = true; } else if (mLauncher.isAllAppsVisible() && !mAppsView.shouldContainerScroll(ev)) { @@ -159,9 +159,8 @@ public class AllAppsTransitionController implements TouchController, VerticalPul return true; } } else { - if ((mLauncher.getDragLayer().isEventOverHotseat(ev) - || mLauncher.getDragLayer().isEventOverPageIndicator(ev)) - && !grid.isVerticalBarLayout()) { + if (mLauncher.getDragLayer().isEventOverHotseat(ev) || + mLauncher.getDragLayer().isEventOverPageIndicator(ev)) { return true; } } -- cgit v1.2.3