From 94f78a5c44c08b258f59b2c78ff6694e5eaca827 Mon Sep 17 00:00:00 2001 From: Patrick Dubroy Date: Mon, 28 Feb 2011 17:39:16 -0800 Subject: Fix 3493373: back button displays blue homescreen borders When the back button has no other function, briefly turn on the page borders to give the user some feedback on the button press. Change-Id: I31cd4391821b646dffe4e8146fbffd72d934a00f --- src/com/android/launcher2/Launcher.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/com/android/launcher2/Launcher.java') diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 261569ef6..3cd65b168 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -251,6 +251,7 @@ public final class Launcher extends Activity private static HashMap sFolders = new HashMap(); + // The "signpost" images along the bottom of the screen (only in some layouts) private ImageView mPreviousView; private ImageView mNextView; @@ -1682,6 +1683,12 @@ public final class Launcher extends Activity return mWorkspaceLoading || mWaitingForResult; } + // Is the workspace preview (brought up by long-pressing on a signpost icon) visible? + private boolean isPreviewVisible() { + return (mPreviousView != null && mPreviousView.getTag() != null) || + (mNextView != null && mNextView.getTag() != null); + } + private void addItems() { if (LauncherApplication.isScreenXLarge()) { // Animate the widget chooser up from the bottom of the screen @@ -1975,13 +1982,14 @@ public final class Launcher extends Activity public void onBackPressed() { if (mState == State.ALL_APPS || mState == State.CUSTOMIZE) { showWorkspace(true); - } else { + } else if (mWorkspace.getOpenFolder() != null) { closeFolder(); - } - // Some launcher layouts don't have a previous and next view - if (mPreviousView != null) { + } else if (isPreviewVisible()) { dismissPreview(mPreviousView); dismissPreview(mNextView); + } else { + // Back button is a no-op here, but give at least some feedback for the button press + mWorkspace.showOutlinesTemporarily(); } } -- cgit v1.2.3