OSDN Git Service

Fix issue with some home button presses being ignored.
authorPatrick Dubroy <dubroy@google.com>
Thu, 24 Feb 2011 19:42:23 +0000 (11:42 -0800)
committerPatrick Dubroy <dubroy@google.com>
Thu, 24 Feb 2011 19:43:59 +0000 (11:43 -0800)
We are ignoring home button presses after panning away from
the default screen, when the workspace is still moving slightly.

Also, make the home button a no-op when the user is in the
middle of panning the screen (i.e. finger is still down).

Change-Id: Ida6bad4faaf90b6802aac2cbf3444f76b7b38100

src/com/android/launcher2/Launcher.java
src/com/android/launcher2/Workspace.java

index 7920472..59f142a 100644 (file)
@@ -1449,7 +1449,7 @@ public final class Launcher extends Activity
                 mWorkspace.unshrink(alreadyOnHome);
             }
 
-            if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isDefaultPageShowing()) {
+            if (alreadyOnHome && mState == State.WORKSPACE && !mWorkspace.isTouchActive()) {
                 mWorkspace.moveToDefaultScreen(true);
             }
             showWorkspace(alreadyOnHome);
index fe54ae7..394614f 100644 (file)
@@ -419,8 +419,8 @@ public class Workspace extends SmoothPagedView
         return folders;
     }
 
-    boolean isDefaultPageShowing() {
-        return mCurrentPage == mDefaultPage;
+    boolean isTouchActive() {
+        return mTouchState != TOUCH_STATE_REST;
     }
 
     /**