diff options
author | Patrick Dubroy <dubroy@google.com> | 2011-02-28 17:39:16 -0800 |
---|---|---|
committer | Patrick Dubroy <dubroy@google.com> | 2011-02-28 18:15:14 -0800 |
commit | 94f78a5c44c08b258f59b2c78ff6694e5eaca827 (patch) | |
tree | c582eb9ccc94378854c99931c08fafd01e6ee912 /src/com/android/launcher2/Launcher.java | |
parent | 60b753b4cfa709efa55e05cdcd62a993330f3684 (diff) | |
download | android_packages_apps_Trebuchet-94f78a5c44c08b258f59b2c78ff6694e5eaca827.tar.gz android_packages_apps_Trebuchet-94f78a5c44c08b258f59b2c78ff6694e5eaca827.tar.bz2 android_packages_apps_Trebuchet-94f78a5c44c08b258f59b2c78ff6694e5eaca827.zip |
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
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 16 |
1 files changed, 12 insertions, 4 deletions
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<Long, FolderInfo> sFolders = new HashMap<Long, FolderInfo>(); + // 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(); } } |