Merge "More work to ensure that the wallpaper is visible before transitions take place. (Bug 6445085)" into jb-dev
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user