Fix toggle display and preferen style old style and barely seen in “Vision Settings”

Root cause: Apply ThemeHelper.trySetDynamicColor would overlay the
settings style.
Solution: Create SudDynamicColorThemeSettings.SetupWizard to support
dynamicColor and settings style.

Bug: 192410829
Test: manual test
Change-Id: Ic196dfe417e7f804c68ed4ea7bc05b4716999bcf
This commit is contained in:
menghanli
2021-07-05 19:52:22 +08:00
parent dc07fe1ad1
commit e18c419f94
3 changed files with 40 additions and 5 deletions

View File

@@ -91,10 +91,17 @@ public class SettingsBaseActivity extends FragmentActivity implements CategoryHa
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (isAnySetupWizard && this instanceof SubSettings) {
final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SubSettings_SetupWizard : R.style.SudThemeGlifV3_Light;
int appliedTheme;
if (ThemeHelper.trySetDynamicColor(this)) {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight
: R.style.SudDynamicColorThemeSettings_SetupWizard;
} else {
appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SubSettings_SetupWizard
: R.style.SudThemeGlifV3_Light;
}
setTheme(appliedTheme);
ThemeHelper.trySetDynamicColor(this);
}
if (isToolbarEnabled() && !isAnySetupWizard) {