diff --git a/quickstep/res/values/styles.xml b/quickstep/res/values/styles.xml index a6ea90d311..26a96284f6 100644 --- a/quickstep/res/values/styles.xml +++ b/quickstep/res/values/styles.xml @@ -391,7 +391,6 @@ @androidprv:color/surface_effect_2 @androidprv:color/surface_effect_3 @androidprv:color/surface_effect_1 - ?attr/overviewScrimColorBlur + + + + + diff --git a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java index dc10c0f638..806f39e3bb 100644 --- a/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java +++ b/quickstep/src/com/android/launcher3/QuickstepTransitionManager.java @@ -1139,7 +1139,7 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener private Animator getBackgroundAnimator() { LauncherState launcherState = mLauncher.getStateManager().getState(); boolean currentlyBlurringAllApps = Flags.allAppsBlur() && launcherState == ALL_APPS - && mLauncher.isBackgroundBlurEnabled(); + && mLauncher.isAllAppsBackgroundBlurEnabled(); if (currentlyBlurringAllApps) { // Don't additionally animate/blur the background for this launch (All Apps content // already scales slightly to simulate depth). diff --git a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java index def4754f00..578e646607 100644 --- a/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java +++ b/quickstep/src/com/android/launcher3/taskbar/allapps/TaskbarAllAppsSlideInView.java @@ -114,7 +114,7 @@ public class TaskbarAllAppsSlideInView extends AbstractSlideInView recentsView = getOverviewPanel(); - recentsView.updateBlurStyle(isBackgroundBlurEnabled()); + recentsView.updateBlurStyle(isOverviewBackgroundBlurEnabled()); } } @@ -1575,4 +1583,10 @@ public class QuickstepLauncher extends Launcher implements RecentsViewContainer, public void returnToHomescreen() { getStateManager().goToState(LauncherState.NORMAL); } + + @Override + public int getOverviewBlurStyleResId() { + return isOverviewBackgroundBlurEnabled() ? R.style.OverviewBlurStyle + : R.style.OverviewBlurFallbackStyle; + } } diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java index b867511fc7..b6f7c4da67 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/PortraitStatesTouchController.java @@ -220,7 +220,8 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr @Override protected void onReinitToState(LauncherState newToState) { super.onReinitToState(newToState); - if (Flags.allAppsBlur() && mLauncher.isBackgroundBlurEnabled() && newToState == ALL_APPS) { + if (Flags.allAppsBlur() && mLauncher.isAllAppsBackgroundBlurEnabled() + && newToState == ALL_APPS) { // About to start blurring during swipe to All Apps; prepare the renderer. Trace.instantForTrack(TRACE_TAG_APP, TAG, "notifyRendererForGpuLoadUp"); mLauncher.getRootView().getViewRootImpl().notifyRendererForGpuLoadUp( diff --git a/quickstep/src/com/android/quickstep/RecentsActivity.java b/quickstep/src/com/android/quickstep/RecentsActivity.java index 95b6dc5605..69075dce92 100644 --- a/quickstep/src/com/android/quickstep/RecentsActivity.java +++ b/quickstep/src/com/android/quickstep/RecentsActivity.java @@ -134,6 +134,7 @@ public final class RecentsActivity extends StatefulActivity implem * Init drag layer and overview panel views. */ protected void setupViews() { + getTheme().applyStyle(getOverviewBlurStyleResId(), true); SystemUiProxy systemUiProxy = SystemUiProxy.INSTANCE.get(this); // SplitSelectStateController needs to be created before setContentView() mSplitSelectStateController = @@ -374,7 +375,6 @@ public final class RecentsActivity extends StatefulActivity implem protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setWallpaperDependentTheme(this); - getTheme().applyStyle(getBlurStyleResId(), true); mStateManager = new StateManager<>(this, RecentsState.BG_LAUNCHER); initDeviceProfile(); @@ -564,7 +564,7 @@ public final class RecentsActivity extends StatefulActivity implem } @Override - public int getBlurStyleResId() { - return R.style.BlurFallbackStyle; + public int getOverviewBlurStyleResId() { + return R.style.OverviewBlurFallbackStyle; } } diff --git a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt index f2d516c936..1e322133ec 100644 --- a/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt +++ b/quickstep/src/com/android/quickstep/fallback/window/RecentsWindowManager.kt @@ -251,9 +251,11 @@ constructor( if (isShowing()) { return } + theme.applyStyle(overviewBlurStyleResId, true) if (windowView == null) { windowView = layoutInflater.inflate(R.layout.fallback_recents_activity, null) } + windowManager.addView(windowView, windowLayoutParams) windowView?.let { @@ -503,6 +505,10 @@ constructor( return RecentsAtomicAnimationFactory(this) } + override fun getOverviewBlurStyleResId(): Int { + return R.style.OverviewBlurFallbackStyle + } + @AssistedFactory interface Factory { /** Creates a new instance of [RecentsWindowManager] for a given [context]. */ diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index d20a683b66..8030056d82 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -27,6 +27,7 @@ import static com.android.launcher3.AbstractFloatingView.TYPE_FOLDER; import static com.android.launcher3.AbstractFloatingView.TYPE_ICON_SURFACE; import static com.android.launcher3.AbstractFloatingView.TYPE_REBIND_SAFE; import static com.android.launcher3.AbstractFloatingView.getTopOpenViewWithType; +import static com.android.launcher3.Flags.allAppsBlur; import static com.android.launcher3.Flags.enableAddAppWidgetViaConfigActivityV2; import static com.android.launcher3.Flags.enableStrictMode; import static com.android.launcher3.Flags.enableWorkspaceInflation; @@ -514,7 +515,6 @@ public class Launcher extends StatefulActivity super.onCreate(savedInstanceState); setWallpaperDependentTheme(this); - getTheme().applyStyle(getBlurStyleResId(), true); LauncherAppState app = LauncherAppState.getInstance(this); mModel = app.getModel(); @@ -1370,6 +1370,9 @@ public class Launcher extends StatefulActivity * Finds all the views we need and configure them properly. */ protected void setupViews() { + if (allAppsBlur()) { + getTheme().applyStyle(getAllAppsBlurStyleResId(), true); + } mStartupLatencyLogger.logStart(LAUNCHER_LATENCY_STARTUP_VIEW_INFLATION); inflateRootView(R.layout.launcher); mStartupLatencyLogger.logEnd(LAUNCHER_LATENCY_STARTUP_VIEW_INFLATION); diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java index 75757a4e95..c238f3bb2b 100644 --- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java @@ -846,7 +846,7 @@ public class ActivityAllAppsContainerView if (!Flags.allAppsBlur()) { return mBottomSheetBackgroundColorLegacy; } - if (!mActivityContext.isBackgroundBlurEnabled()) { + if (!mActivityContext.isAllAppsBackgroundBlurEnabled()) { // Don't apply any alpha if the blur is disabled. return mBottomSheetBackgroundColorBlurFallback; } @@ -854,7 +854,7 @@ public class ActivityAllAppsContainerView } boolean isBackgroundBlurEnabled() { - return Flags.allAppsBlur() && mActivityContext.isBackgroundBlurEnabled(); + return Flags.allAppsBlur() && mActivityContext.isAllAppsBackgroundBlurEnabled(); } /** Refresh the UI according to the current theme. */ diff --git a/src/com/android/launcher3/views/ActivityContext.java b/src/com/android/launcher3/views/ActivityContext.java index 50c941b251..dbcb466598 100644 --- a/src/com/android/launcher3/views/ActivityContext.java +++ b/src/com/android/launcher3/views/ActivityContext.java @@ -209,14 +209,23 @@ public interface ActivityContext extends SavedStateRegistryOwner { return null; } - /** @return {@code true} if background blur is enabled */ - default boolean isBackgroundBlurEnabled() { + /** @return {@code true} if all apps background blur is enabled */ + default boolean isAllAppsBackgroundBlurEnabled() { + return false; + } + + /** @return {@code true} if overview background blur is enabled */ + default boolean isOverviewBackgroundBlurEnabled() { return false; } /** @return the resource id of the style to apply for the current blur state. */ - default int getBlurStyleResId() { - return isBackgroundBlurEnabled() ? R.style.BlurStyle : R.style.BlurFallbackStyle; + default int getAllAppsBlurStyleResId() { + return isAllAppsBackgroundBlurEnabled() ? R.style.BlurStyle : R.style.BlurFallbackStyle; + } + + default int getOverviewBlurStyleResId() { + return View.NO_ID; } DeviceProfile getDeviceProfile();