Fix background inconsistency of the font size page in SUW

- Apply to SUW provided theme.
- Use isSetupWizardDayNightEnabled to decide which device's SUW supports dark mode.

Fixes: 184901818
Bug: 186076332
Test: manual test
Change-Id: I44c5f8ee19dac58dea7f5543840659c08aad4a39
This commit is contained in:
Sunny Shao
2021-04-23 13:32:52 +08:00
parent c6c3b383da
commit 2ba1ab2222
5 changed files with 13 additions and 17 deletions

View File

@@ -48,6 +48,7 @@ import com.android.settingslib.drawer.Tile;
import com.google.android.material.appbar.CollapsingToolbarLayout;
import com.google.android.setupcompat.util.WizardManagerHelper;
import com.google.android.setupdesign.util.ThemeHelper;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -90,7 +91,9 @@ public class SettingsBaseActivity extends FragmentActivity {
// Apply SetupWizard light theme during setup flow. This is for SubSettings pages.
final boolean isAnySetupWizard = WizardManagerHelper.isAnySetupWizard(getIntent());
if (isAnySetupWizard && this instanceof SubSettings) {
setTheme(R.style.LightTheme_SubSettings_SetupWizard);
final int appliedTheme = ThemeHelper.isSetupWizardDayNightEnabled(this)
? R.style.SubSettings_SetupWizard : R.style.SudThemeGlifV3_Light;
setTheme(appliedTheme);
}
if (FeatureFlagUtils.isEnabled(this, FeatureFlags.SILKY_HOME)
@@ -201,6 +204,7 @@ public class SettingsBaseActivity extends FragmentActivity {
/**
* SubSetting page should show a toolbar by default. If the page wouldn't show a toolbar,
* override this method and return false value.
*
* @return ture by default
*/
protected boolean isToolbarEnabled() {