summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorPatrick Dubroy <dubroy@google.com>2011-03-01 10:28:22 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-03-01 10:28:22 -0800
commit3ad0c132de2ccc7aacc7daddb596b0e3c58a2eb0 (patch)
tree33da49cb0e16633889ac3a40be96efa044d988a0 /src/com/android
parentc8c80b0b42db7ee604af6ae89e67aede3c404d7b (diff)
parent94f78a5c44c08b258f59b2c78ff6694e5eaca827 (diff)
downloadandroid_packages_apps_Trebuchet-3ad0c132de2ccc7aacc7daddb596b0e3c58a2eb0.tar.gz
android_packages_apps_Trebuchet-3ad0c132de2ccc7aacc7daddb596b0e3c58a2eb0.tar.bz2
android_packages_apps_Trebuchet-3ad0c132de2ccc7aacc7daddb596b0e3c58a2eb0.zip
Merge "Fix 3493373: back button displays blue homescreen borders"
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/Launcher.java16
-rw-r--r--src/com/android/launcher2/Workspace.java10
2 files changed, 20 insertions, 6 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index b95feaf5e..3df8c4a6c 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;
@@ -1691,6 +1692,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
@@ -1984,13 +1991,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();
}
}
diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java
index ef0cf228b..3e5a96795 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -896,7 +896,7 @@ public class Workspace extends SmoothPagedView
}
}
- public void showOutlines() {
+ void showOutlines() {
if (!mIsSmall && !mIsInUnshrinkAnimation) {
if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel();
@@ -906,7 +906,7 @@ public class Workspace extends SmoothPagedView
}
}
- public void hideOutlines() {
+ void hideOutlines() {
if (!mIsSmall && !mIsInUnshrinkAnimation) {
if (mChildrenOutlineFadeInAnimation != null) mChildrenOutlineFadeInAnimation.cancel();
if (mChildrenOutlineFadeOutAnimation != null) mChildrenOutlineFadeOutAnimation.cancel();
@@ -917,6 +917,12 @@ public class Workspace extends SmoothPagedView
}
}
+ public void showOutlinesTemporarily() {
+ if (!mIsPageMoving && !isTouchActive()) {
+ snapToPage(mCurrentPage);
+ }
+ }
+
public void setChildrenOutlineAlpha(float alpha) {
mChildrenOutlineAlpha = alpha;
for (int i = 0; i < getChildCount(); i++) {