From 31ce073f6a4a6e3e71d533ea4a2a423c2509ad89 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Sun, 6 May 2012 13:36:43 -0700 Subject: [PATCH] Keying off the Launcher state to determine wallpaper visibility (Bug 6396752) Change-Id: I00c457d9c07113bf8ff4c7102e486efcb030ddc4 --- .../android/launcher2/AppsCustomizeTabHost.java | 11 ----------- src/com/android/launcher2/Launcher.java | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/com/android/launcher2/AppsCustomizeTabHost.java b/src/com/android/launcher2/AppsCustomizeTabHost.java index 7a2c247c65..d3afc3bf03 100644 --- a/src/com/android/launcher2/AppsCustomizeTabHost.java +++ b/src/com/android/launcher2/AppsCustomizeTabHost.java @@ -471,17 +471,6 @@ public class AppsCustomizeTabHost extends TabHost implements LauncherTransitiona // Load the current page synchronously, and the neighboring pages asynchronously mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage(), true); mAppsCustomizePane.loadAssociatedPages(mAppsCustomizePane.getCurrentPage()); - - // We had to enable the wallpaper visibility when launching apps from all apps (so that - // the transitions would be the same as when launching from workspace) so we need to - // re-disable the wallpaper visibility to ensure performance. - int duration = getResources().getInteger(android.R.integer.config_shortAnimTime); - postDelayed(new Runnable() { - @Override - public void run() { - mLauncher.updateWallpaperVisibility(false); - } - }, duration); } } diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 0d4b0d0413..ff8e785948 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1180,6 +1180,23 @@ public final class Launcher extends Activity // currently shown, because doing that may involve // some communication back with the app. mWorkspace.postDelayed(mBuildLayersRunnable, 500); + + // We had to enable the wallpaper visibility when launching apps from all + // apps (so that the transitions would be the same as when launching from + // workspace) so take this time to see if we need to re-disable the + // wallpaper visibility to ensure performance. + mWorkspace.post(new Runnable() { + @Override + public void run() { + if (mState == State.APPS_CUSTOMIZE) { + if (mAppsCustomizeTabHost != null && + !mAppsCustomizeTabHost.isTransitioning()) { + updateWallpaperVisibility(false); + } + } + } + }); + observer.removeOnPreDrawListener(this); return true; }