Disable tap to switch pages on phones

Change-Id: I15b911c2785df5aa124814c6128523042104b4da
This commit is contained in:
Michael Jurka
2011-09-14 14:53:19 -07:00
parent d90466bc77
commit b72094fe1d
+8 -2
View File
@@ -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);
}
/**