Improve support for default theme of WifiSetupActivity

Default theme can be either dark or light, depending on the app theme
in the manifest. When processing extras, the default was always
assumed to be dark.

Change-Id: I4598ad25ffa69b63fa91cab8b07931ba37ba7676
This commit is contained in:
Russell Brenner
2014-03-18 15:17:35 -07:00
parent bc64d5030e
commit 7552ff38b1

View File

@@ -32,9 +32,12 @@ public class WifiSetupActivity extends WifiPickerActivity implements ButtonBarHa
@Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
String themeName = getIntent().getStringExtra(EXTRA_THEME);
if (themeName != null && themeName.equalsIgnoreCase(THEME_HOLO_LIGHT)) {
if (THEME_HOLO_LIGHT.equalsIgnoreCase(themeName)) {
resid = getResources().getIdentifier(RESOURCE_THEME_LIGHT, "style",
getPackageName());
} else if (THEME_HOLO.equalsIgnoreCase(themeName)) {
resid = getResources().getIdentifier(RESOURCE_THEME_DARK, "style",
getPackageName());
}
super.onApplyThemeResource(theme, resid, first);
}