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

@@ -101,12 +101,22 @@ public class AccessibilitySettingsForSetupWizardActivity extends SettingsActivit
@Override
protected void onCreate(Bundle savedState) {
super.onCreate(savedState);
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
ThemeHelper.trySetDynamicColor(this);
applyTheme();
tryLaunchFontSizeSettings();
findViewById(R.id.content_parent).setFitsSystemWindows(false);
}
private void applyTheme() {
if (ThemeHelper.trySetDynamicColor(this)) {
final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight
: R.style.SudDynamicColorThemeSettings_SetupWizard;
setTheme(appliedTheme);
} else {
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
}
}
@VisibleForTesting
void tryLaunchFontSizeSettings() {
if (WizardManagerHelper.isAnySetupWizard(getIntent())