Apply Glif theme before using dynamic color.

As changes are being made to remove the dependency between dynamic
color and the glifv3 theme, this sets the Glif theme before calling
trySetDymanicColor, as requested.

Bug: 219882220
Test: Build & flash; visual inspection
Change-Id: I4c28ea52411f3436c98e4689c7fa1784254fd572
This commit is contained in:
menghanli
2022-03-03 05:18:10 +08:00
parent 2164070f4a
commit b759790da1
2 changed files with 2 additions and 4 deletions

View File

@@ -110,13 +110,12 @@ public class AccessibilitySettingsForSetupWizardActivity extends SettingsActivit
} }
private void applyTheme() { private void applyTheme() {
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
if (ThemeHelper.trySetDynamicColor(this)) { if (ThemeHelper.trySetDynamicColor(this)) {
final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this) final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight ? R.style.SudDynamicColorThemeSettings_SetupWizard_DayNight
: R.style.SudDynamicColorThemeSettings_SetupWizard; : R.style.SudDynamicColorThemeSettings_SetupWizard;
setTheme(appliedTheme); setTheme(appliedTheme);
} else {
setTheme(SetupWizardUtils.getTheme(this, getIntent()));
} }
} }

View File

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