Tapping on mini-screen in All Apps view now goes back to home screen

- had to disable touch event swallowing in workspace in X-Large mode to get this to work
- also changed default screen in XLarge mode to 2 (the middle one)
This commit is contained in:
Michael Jurka 2010-07-30 14:47:52 -07:00
parent b0f28bd9a5
commit 54dd75463d
3 changed files with 10 additions and 4 deletions

View File

@ -34,6 +34,7 @@
android:id="@+id/workspace" android:id="@+id/workspace"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
launcher:defaultScreen="2"
launcher:canonicalDeviceWidth="8" launcher:canonicalDeviceWidth="8"
launcher:canonicalDeviceHeight="4"> launcher:canonicalDeviceHeight="4">

View File

@ -2147,8 +2147,7 @@ public final class Launcher extends Activity
void onWorkspaceUnshrink() { void onWorkspaceUnshrink() {
if (isAllAppsVisible()) { if (isAllAppsVisible()) {
// TODO: Make a smoother transition here closeAllApps(true);
closeAllApps(false);
} }
if (isCustomizationDrawerVisible()) { if (isCustomizationDrawerVisible()) {
hideCustomizationDrawer(); hideCustomizationDrawer();

View File

@ -804,7 +804,10 @@ public class Workspace extends ViewGroup
@Override @Override
public boolean dispatchTouchEvent(MotionEvent ev) { public boolean dispatchTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) { if (ev.getAction() == MotionEvent.ACTION_DOWN) {
if (mLauncher.isWorkspaceLocked() || mLauncher.isAllAppsVisible()) { // (In XLarge mode, the workspace is shrunken below all apps, and responds to taps
// ie when you click on a mini-screen, it zooms back to that screen)
if (mLauncher.isWorkspaceLocked() ||
(!LauncherApplication.isScreenXLarge() && mLauncher.isAllAppsVisible())) {
return false; return false;
} }
} }
@ -815,7 +818,10 @@ public class Workspace extends ViewGroup
public boolean onInterceptTouchEvent(MotionEvent ev) { public boolean onInterceptTouchEvent(MotionEvent ev) {
final boolean workspaceLocked = mLauncher.isWorkspaceLocked(); final boolean workspaceLocked = mLauncher.isWorkspaceLocked();
final boolean allAppsVisible = mLauncher.isAllAppsVisible(); final boolean allAppsVisible = mLauncher.isAllAppsVisible();
if (workspaceLocked || allAppsVisible) {
// (In XLarge mode, the workspace is shrunken below all apps, and responds to taps
// ie when you click on a mini-screen, it zooms back to that screen)
if (workspaceLocked || (!LauncherApplication.isScreenXLarge() && allAppsVisible)) {
return false; // We don't want the events. Let them fall through to the all apps view. return false; // We don't want the events. Let them fall through to the all apps view.
} }