am 2bc6b7c2: Fix the bug where you can grab the workspace while all apps is animating.
Merge commit '2bc6b7c2b8b651dde0a65c64c127f5b85c1290d2'
* commit '2bc6b7c2b8b651dde0a65c64c127f5b85c1290d2':
Fix the bug where you can grab the workspace while all apps is animating.
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index 788915e..b2f0a4d 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -769,7 +769,15 @@
@Override
public boolean onTouchEvent(MotionEvent ev) {
- if (mLauncher.isWorkspaceLocked() || mLauncher.isAllAppsVisible()) {
+ if (mLauncher.isWorkspaceLocked()) {
+ return false; // We don't want the events. Let them fall through to the all apps view.
+ }
+ if (mLauncher.isAllAppsVisible()) {
+ // Cancel any scrolling that is in progress.
+ if (!mScroller.isFinished()) {
+ mScroller.abortAnimation();
+ }
+ snapToScreen(mCurrentScreen);
return false; // We don't want the events. Let them fall through to the all apps view.
}