diff options
author | Winson Chung <winsonc@google.com> | 2012-05-09 13:28:10 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-05-09 13:29:31 -0700 |
commit | 18f41f8327860d7e257d063888d08b6b5c528fe9 (patch) | |
tree | a4c53873fefd0f0184cd01e3292e03c46046e849 /src/com/android/launcher2 | |
parent | f1961269be954960ebe597ad39fc30246c6270fa (diff) | |
download | android_packages_apps_Trebuchet-18f41f8327860d7e257d063888d08b6b5c528fe9.tar.gz android_packages_apps_Trebuchet-18f41f8327860d7e257d063888d08b6b5c528fe9.tar.bz2 android_packages_apps_Trebuchet-18f41f8327860d7e257d063888d08b6b5c528fe9.zip |
More work to ensure that the wallpaper is visible before transitions take place. (Bug 6445085)
Change-Id: Ic8435ba946949674a986aa4eaa879d33044c7884
Diffstat (limited to 'src/com/android/launcher2')
-rw-r--r-- | src/com/android/launcher2/AppsCustomizePagedView.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 29 |
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); } |