diff options
author | Michael Jurka <mikejurka@google.com> | 2011-09-14 14:53:19 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2011-09-14 14:53:19 -0700 |
commit | b72094fe1da249cc16af517d5ef598b3cbcbdf11 (patch) | |
tree | 968ac2a589f18b985c2dcd43c88bb795d9a15bba | |
parent | d90466bc77221f6959f530422f4ec9b4d98b1a5f (diff) | |
download | packages_apps_trebuchet-b72094fe1da249cc16af517d5ef598b3cbcbdf11.zip packages_apps_trebuchet-b72094fe1da249cc16af517d5ef598b3cbcbdf11.tar.gz packages_apps_trebuchet-b72094fe1da249cc16af517d5ef598b3cbcbdf11.tar.bz2 |
Disable tap to switch pages on phones
Change-Id: I15b911c2785df5aa124814c6128523042104b4da
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index 6f952fa..5ca2553 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -512,7 +512,10 @@ public class Workspace extends SmoothPagedView // mNextPage is set to INVALID_PAGE whenever we are stationary. // Calculating "next page" this way ensures that you scroll to whatever page you tap on final int current = (mNextPage == INVALID_PAGE) ? mCurrentPage : mNextPage; - return hitsPage(current - 1, x, y); + + // Only allow tap to next page on large devices, where there's significant margin outside + // the active workspace + return LauncherApplication.isScreenLarge() && hitsPage(current - 1, x, y); } @Override @@ -520,7 +523,10 @@ public class Workspace extends SmoothPagedView // mNextPage is set to INVALID_PAGE whenever we are stationary. // Calculating "next page" this way ensures that you scroll to whatever page you tap on final int current = (mNextPage == INVALID_PAGE) ? mCurrentPage : mNextPage; - return hitsPage(current + 1, x, y); + + // Only allow tap to next page on large devices, where there's significant margin outside + // the active workspace + return LauncherApplication.isScreenLarge() && hitsPage(current + 1, x, y); } /** |