Files
app_Settings/src/com/android/settings/wifi/WifiSetupActivity.java
Russell Brenner 7552ff38b1 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
2014-03-18 15:48:58 -07:00

45 lines
1.8 KiB
Java

/*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.settings.wifi;
import com.android.settings.ButtonBarHandler;
import android.content.res.Resources;
public class WifiSetupActivity extends WifiPickerActivity implements ButtonBarHandler {
// Extra containing the resource name of the theme to be used
private static final String EXTRA_THEME = "theme";
private static final String THEME_HOLO = "holo";
private static final String THEME_HOLO_LIGHT = "holo_light";
// Style resources containing theme settings
private static final String RESOURCE_THEME_DARK = "SetupWizardWifiTheme";
private static final String RESOURCE_THEME_LIGHT = "SetupWizardWifiTheme.Light";
@Override
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
String themeName = getIntent().getStringExtra(EXTRA_THEME);
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);
}
}