diff options
author | Tony Wickham <twickham@google.com> | 2016-03-16 13:53:50 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-03-16 16:28:21 -0700 |
commit | c5b31965d9bcb4c9899e2d1c45b5c95c70bac9f2 (patch) | |
tree | f07a97545fecc764ba0aae075b956c9db9fd5af3 | |
parent | 95cdb3a0211650e76adb451588ce89fd585b178f (diff) | |
download | android_packages_apps_Trebuchet-c5b31965d9bcb4c9899e2d1c45b5c95c70bac9f2.tar.gz android_packages_apps_Trebuchet-c5b31965d9bcb4c9899e2d1c45b5c95c70bac9f2.tar.bz2 android_packages_apps_Trebuchet-c5b31965d9bcb4c9899e2d1c45b5c95c70bac9f2.zip |
Don't listen for the pinch gesture if the workspace is locked.
Bug: 27639653
Change-Id: I1f3b324a4b95cc5deaa2513dcbf4ed5a158a4866
-rw-r--r-- | src/com/android/launcher3/PinchToOverviewListener.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragLayer.java | 9 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/com/android/launcher3/PinchToOverviewListener.java b/src/com/android/launcher3/PinchToOverviewListener.java index ef4748528..02b60446d 100644 --- a/src/com/android/launcher3/PinchToOverviewListener.java +++ b/src/com/android/launcher3/PinchToOverviewListener.java @@ -63,16 +63,24 @@ public class PinchToOverviewListener extends ScaleGestureDetector.SimpleOnScaleG // Don't listen for the pinch gesture if we are already animating from a previous one. return false; } + if (mLauncher.isWorkspaceLocked()) { + // Don't listen for the pinch gesture if the workspace isn't ready. + return false; + } if (mWorkspace == null) { - mWorkspace = mLauncher.mWorkspace; + mWorkspace = mLauncher.getWorkspace(); mThresholdManager = new PinchThresholdManager(mWorkspace); mAnimationManager = new PinchAnimationManager(mLauncher); } if (mWorkspace.isSwitchingState() || mWorkspace.mScrollInteractionBegan) { - // Don't listen to pinches occurring while switching state, as it will cause a jump + // Don't listen for the pinch gesture while switching state, as it will cause a jump // once the state switching animation is complete. return false; } + if (mWorkspace.getOpenFolder() != null) { + // Don't listen for the pinch gesture if a folder is open. + return false; + } mPreviousProgress = mWorkspace.isInOverviewMode() ? OVERVIEW_PROGRESS : WORKSPACE_PROGRESS; mPreviousTimeMillis = System.currentTimeMillis(); diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 058a58cde..40b9179ea 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -250,12 +250,9 @@ public class DragLayer extends InsettableFrameLayout { } clearAllResizeFrames(); - Folder currentFolder = mLauncher.getWorkspace().getOpenFolder(); - if (currentFolder == null) { - if (mPinchListener.onInterceptTouchEvent(ev)) { - // Stop listening for scrolling etc. (onTouchEvent() handles the rest of the pinch.) - return true; - } + if (mPinchListener.onInterceptTouchEvent(ev)) { + // Stop listening for scrolling etc. (onTouchEvent() handles the rest of the pinch.) + return true; } return mDragController.onInterceptTouchEvent(ev); } |