From bb003a540bb4599e020b36c2680e0f0f520b32d6 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Tue, 30 Aug 2011 14:40:07 -0700 Subject: Fix issue #5209847: Make launcher turn off the wallpaper in all apps. Change-Id: If7129048dfb127057aac5761d64125505b0641b0 --- src/com/android/launcher2/Launcher.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/com/android/launcher2') diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index f05850b36..a6c1de6ef 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -76,6 +76,7 @@ import android.view.MotionEvent; import android.view.Surface; import android.view.View; import android.view.ViewGroup; +import android.view.WindowManager; import android.view.View.OnLongClickListener; import android.view.accessibility.AccessibilityEvent; import android.view.animation.DecelerateInterpolator; @@ -2071,6 +2072,15 @@ public final class Launcher extends Activity } } + void updateWallpaperVisibility(boolean visible) { + int wpflags = visible ? WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER : 0; + int curflags = getWindow().getAttributes().flags + & WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER; + if (wpflags != curflags) { + getWindow().setFlags(wpflags, WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER); + } + } + /** * Zoom the camera out from the workspace to reveal 'toView'. * Assumes that the view to show is anchored at either the very top or very bottom @@ -2120,6 +2130,7 @@ public final class Launcher extends Activity scaleAnim.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { + updateWallpaperVisibility(true); // Prepare the position toView.setTranslationX(0.0f); toView.setTranslationY(0.0f); @@ -2142,6 +2153,7 @@ public final class Launcher extends Activity mWorkspace.hideScrollingIndicator(true); mWorkspace.hideDockDivider(true); } + updateWallpaperVisibility(false); } }); @@ -2169,6 +2181,7 @@ public final class Launcher extends Activity mWorkspace.hideDockDivider(true); } } + updateWallpaperVisibility(false); } } @@ -2188,6 +2201,8 @@ public final class Launcher extends Activity setPivotsForZoom(fromView, fromState, scaleFactor); + updateWallpaperVisibility(true); + if (!springLoaded) { mWorkspace.unshrink(animated); } @@ -2230,6 +2245,7 @@ public final class Launcher extends Activity } @Override public void onAnimationEnd(Animator animation) { + updateWallpaperVisibility(true); fromView.setVisibility(View.GONE); if (fromView instanceof LauncherTransitionable) { ((LauncherTransitionable) fromView).onLauncherTransitionEnd(alphaAnim,true); -- cgit v1.2.3