summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-05-09 15:01:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-09 15:01:43 -0700
commitfdfa106c1b4d1b457ed8ec867ce38aafed4814ca (patch)
tree14a798dd66aca50a019cd49d0e8e9d5d955cec21
parent966182f222da8da1fed2ce1f3945fae3d3d488d0 (diff)
parent18f41f8327860d7e257d063888d08b6b5c528fe9 (diff)
downloadandroid_packages_apps_Trebuchet-fdfa106c1b4d1b457ed8ec867ce38aafed4814ca.tar.gz
android_packages_apps_Trebuchet-fdfa106c1b4d1b457ed8ec867ce38aafed4814ca.tar.bz2
android_packages_apps_Trebuchet-fdfa106c1b4d1b457ed8ec867ce38aafed4814ca.zip
Merge "More work to ensure that the wallpaper is visible before transitions take place. (Bug 6445085)" into jb-dev
-rw-r--r--src/com/android/launcher2/AppsCustomizePagedView.java4
-rw-r--r--src/com/android/launcher2/Launcher.java29
2 files changed, 27 insertions, 6 deletions
diff --git a/src/com/android/launcher2/AppsCustomizePagedView.java b/src/com/android/launcher2/AppsCustomizePagedView.java
index 5bd0ac655..54af0803e 100644
--- a/src/com/android/launcher2/AppsCustomizePagedView.java
+++ b/src/com/android/launcher2/AppsCustomizePagedView.java
@@ -524,6 +524,10 @@ public class AppsCustomizePagedView extends PagedViewWithDraggableItems implemen
mPressedIcon.lockDrawableState();
}
+ // NOTE: We want all transitions from launcher to act as if the wallpaper were enabled
+ // to be consistent. So re-enable the flag here, and we will re-disable it as necessary
+ // when Launcher resumes and we are still in AllApps.
+ mLauncher.updateWallpaperVisibility(true);
mLauncher.startActivitySafely(v, appInfo.intent, appInfo);
} else if (v instanceof PagedViewWidget) {
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 0bb119b31..74ec6f3b5 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1204,12 +1204,7 @@ public final class Launcher extends Activity
mWorkspace.post(new Runnable() {
@Override
public void run() {
- if (mState == State.APPS_CUSTOMIZE) {
- if (mAppsCustomizeTabHost != null &&
- !mAppsCustomizeTabHost.isTransitioning()) {
- updateWallpaperVisibility(false);
- }
- }
+ disableWallpaperIfInAllApps();
}
});
@@ -2191,6 +2186,16 @@ public final class Launcher extends Activity
view.setPivotY(view.getHeight() / 2.0f);
}
+ void disableWallpaperIfInAllApps() {
+ // Only disable it if we are in all apps
+ if (mState == State.APPS_CUSTOMIZE) {
+ if (mAppsCustomizeTabHost != null &&
+ !mAppsCustomizeTabHost.isTransitioning()) {
+ updateWallpaperVisibility(false);
+ }
+ }
+ }
+
void updateWallpaperVisibility(boolean visible) {
int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0;
int curflags = getWindow().getAttributes().flags
@@ -2534,6 +2539,18 @@ public final class Launcher extends Activity
}
}
+ @Override
+ public void onWindowFocusChanged(boolean hasFocus) {
+ if (!hasFocus) {
+ // When another window occludes launcher (like the notification shade, or recents),
+ // ensure that we enable the wallpaper flag so that transitions are done correctly.
+ updateWallpaperVisibility(true);
+ } else {
+ // When launcher has focus again, disable the wallpaper if we are in AllApps
+ disableWallpaperIfInAllApps();
+ }
+ }
+
void showWorkspace(boolean animated) {
showWorkspace(animated, null);
}