diff --git a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java index 94746fd8a0..6828ec4318 100644 --- a/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java @@ -345,8 +345,10 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT // Start at 1 because relevant flags are unset at init. mOnBackgroundNavButtonColorOverrideMultiplier.value = 1; - // Potentially force the back button to be visible during setup wizard. - boolean shouldShowInSetup = !mContext.isUserSetupComplete() && !mIsExpressiveThemeEnabled; + // Potentially force the back button to be visible during setup wizard. The back button + // won't show up if the expressive theme is enabled and simple view is disabled + boolean shouldShowInSetup = !mContext.isUserSetupComplete() + && (!mIsExpressiveThemeEnabled || mContext.isSimpleViewEnabled()); boolean isInKidsMode = mContext.isNavBarKidsModeActive(); boolean alwaysShowButtons = isThreeButtonNav || shouldShowInSetup; @@ -995,15 +997,15 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT if (mFloatingRotationButton != null) { mFloatingRotationButton.onConfigurationChanged(configChanges); } - if (!mContext.isUserSetupComplete()) { + if (!mContext.isUserSetupComplete() && !ENABLE_TASKBAR_NAVBAR_UNIFICATION) { handleSetupUi(); } updateButtonLayoutSpacing(); } private void handleSetupUi() { - // Setup wizard handles the UI when the expressive theme is enabled. - if (mIsExpressiveThemeEnabled) { + // Setup wizard handles the UI when the expressive theme is enabled and Simple View isn't. + if (mIsExpressiveThemeEnabled && !mContext.isSimpleViewEnabled()) { return; } // Since setup wizard only has back button enabled, it looks strange to be diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index 653bef9429..e4b81dc206 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -207,6 +207,8 @@ public class TaskbarActivityContext extends BaseTaskbarContext { private static final String WINDOW_TITLE = "Taskbar"; + public static final String SIMPLE_VIEW_SETTINGS_KEY = "matcha_enable"; + protected static final DesktopModeFlag ENABLE_TASKBAR_BEHIND_SHADE = new DesktopModeFlag( Flags::enableTaskbarBehindShade, false); @@ -2017,6 +2019,18 @@ public class TaskbarActivityContext extends BaseTaskbarContext { return mIsUserSetupComplete; } + /** + * Checks if the simple view mode is enabled. + * + * Since Simple View puts the device in 3 button nav mode, we use that as a precursor to + * checking the actual value in Settings to avoid extra calls to Settings. + */ + public boolean isSimpleViewEnabled() { + return isThreeButtonNav() + && Settings.Secure.getInt(getContentResolver(), SIMPLE_VIEW_SETTINGS_KEY, 0) + > 0; + } + public boolean isNavBarKidsModeActive() { return mIsNavBarKidsMode && isThreeButtonNav(); } diff --git a/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt b/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt index eb3fdeb99e..99a2382827 100644 --- a/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt +++ b/quickstep/src/com/android/launcher3/taskbar/navbutton/SetupNavLayoutter.kt @@ -59,7 +59,9 @@ class SetupNavLayoutter( override fun layoutButtons(context: TaskbarActivityContext, isA11yButtonPersistent: Boolean) { val SUWTheme = SystemProperties.get(SUW_THEME_SYSTEM_PROPERTY, "") - if (SUWTheme == GLIF_EXPRESSIVE_THEME || SUWTheme == GLIF_EXPRESSIVE_LIGHT_THEME) { + val expressiveThemeEnabled = + SUWTheme == GLIF_EXPRESSIVE_THEME || SUWTheme == GLIF_EXPRESSIVE_LIGHT_THEME + if (expressiveThemeEnabled && !context.isSimpleViewEnabled) { return } // Since setup wizard only has back button enabled, it looks strange to be