Merge "Add support for material_blue theme"

This commit is contained in:
Maurice Lam
2015-04-09 20:13:35 +00:00
committed by Android (Google) Code Review
7 changed files with 14 additions and 15 deletions

View File

@@ -52,7 +52,7 @@ public class SetupChooseLockGeneric extends ChooseLockGeneric
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }

View File

@@ -63,7 +63,7 @@ public class SetupChooseLockPassword extends ChooseLockPassword
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }

View File

@@ -61,7 +61,7 @@ public class SetupChooseLockPattern extends ChooseLockPattern
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }

View File

@@ -62,7 +62,7 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }

View File

@@ -60,7 +60,7 @@ public class SetupRedactionInterstitial extends RedactionInterstitial
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }

View File

@@ -38,6 +38,8 @@ public class SetupWizardUtils {
public static final String THEME_HOLO_LIGHT = "holo_light"; public static final String THEME_HOLO_LIGHT = "holo_light";
public static final String THEME_MATERIAL = "material"; public static final String THEME_MATERIAL = "material";
public static final String THEME_MATERIAL_LIGHT = "material_light"; public static final String THEME_MATERIAL_LIGHT = "material_light";
public static final String THEME_MATERIAL_BLUE = "material_blue";
public static final String THEME_MATERIAL_BLUE_LIGHT = "material_blue_light";
public static final String EXTRA_USE_IMMERSIVE_MODE = "useImmersiveMode"; public static final String EXTRA_USE_IMMERSIVE_MODE = "useImmersiveMode";
@@ -68,17 +70,14 @@ public class SetupWizardUtils {
activity.startActivityForResult(nextIntent, NEXT_REQUEST); activity.startActivityForResult(nextIntent, NEXT_REQUEST);
} }
public static int getTheme(Intent intent, int defaultResId) { public static int getTheme(Intent intent) {
final String themeName = intent.getStringExtra(EXTRA_THEME); final String themeName = intent.getStringExtra(EXTRA_THEME);
int resid = defaultResId; if (THEME_HOLO.equalsIgnoreCase(themeName) || THEME_MATERIAL.equalsIgnoreCase(themeName)
if (THEME_HOLO_LIGHT.equalsIgnoreCase(themeName) || || THEME_MATERIAL_BLUE.equalsIgnoreCase(themeName)) {
THEME_MATERIAL_LIGHT.equalsIgnoreCase(themeName)) { return R.style.SetupWizardTheme;
resid = R.style.SetupWizardTheme_Light; } else {
} else if (THEME_HOLO.equalsIgnoreCase(themeName) || return R.style.SetupWizardTheme_Light;
THEME_MATERIAL.equalsIgnoreCase(themeName)) {
resid = R.style.SetupWizardTheme;
} }
return resid;
} }
/** /**

View File

@@ -180,7 +180,7 @@ public class WifiSetupActivity extends WifiPickerActivity
@Override @Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) { protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
resid = SetupWizardUtils.getTheme(getIntent(), resid); resid = SetupWizardUtils.getTheme(getIntent());
super.onApplyThemeResource(theme, resid, first); super.onApplyThemeResource(theme, resid, first);
} }