From dd3e2434eedeceb4051bf2618556b1c698ac9def Mon Sep 17 00:00:00 2001 From: Maurice Lam Date: Thu, 5 Nov 2015 18:51:05 -0800 Subject: [PATCH] [WifiDialog] Theme for setup wizard Use setup wizard themes so that dialogs are shown in the correct accent colors and dark/light themes. Bug: 25515641 Change-Id: I87a0a01001944b50e48ec812f071a988f37ed8db --- res/values/themes.xml | 14 ++++++++++++++ src/com/android/settings/SetupWizardUtils.java | 8 ++++++++ .../android/settings/wifi/WifiDialogActivity.java | 8 +++++++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/res/values/themes.xml b/res/values/themes.xml index 0a265de6ab0..059b93486fd 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -85,6 +85,20 @@ @color/setup_lock_pattern_view_error_color_light + + + + diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java index b7a2447df62..71501b1aa31 100644 --- a/src/com/android/settings/SetupWizardUtils.java +++ b/src/com/android/settings/SetupWizardUtils.java @@ -41,6 +41,14 @@ public class SetupWizardUtils { } } + public static int getTransparentTheme(Intent intent) { + if (WizardManagerHelper.isLightTheme(intent, true)) { + return R.style.SetupWizardTheme_Light_Transparent; + } else { + return R.style.SetupWizardTheme_Transparent; + } + } + /** * Sets the immersive mode related flags based on the extra in the intent which started the * activity. diff --git a/src/com/android/settings/wifi/WifiDialogActivity.java b/src/com/android/settings/wifi/WifiDialogActivity.java index 9cadef96ca6..b15a6e43a5c 100644 --- a/src/com/android/settings/wifi/WifiDialogActivity.java +++ b/src/com/android/settings/wifi/WifiDialogActivity.java @@ -25,7 +25,9 @@ import android.net.wifi.WifiManager; import android.os.Bundle; import android.util.Log; +import com.android.settings.SetupWizardUtils; import com.android.settingslib.wifi.AccessPoint; +import com.android.setupwizardlib.util.WizardManagerHelper; public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialogListener, DialogInterface.OnDismissListener { @@ -40,9 +42,13 @@ public class WifiDialogActivity extends Activity implements WifiDialog.WifiDialo @Override protected void onCreate(Bundle savedInstanceState) { + final Intent intent = getIntent(); + if (WizardManagerHelper.isSetupWizardIntent(intent)) { + setTheme(SetupWizardUtils.getTransparentTheme(intent)); + } + super.onCreate(savedInstanceState); - final Intent intent = getIntent(); final Bundle accessPointState = intent.getBundleExtra(KEY_ACCESS_POINT_STATE); AccessPoint accessPoint = null; if (accessPointState != null) {