Merge "[WifiDialog] Theme for setup wizard"
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 0a265de..059b934 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -85,6 +85,20 @@
         <item name="@*android:errorColor">@color/setup_lock_pattern_view_error_color_light</item>
     </style>
 
+    <style name="SetupWizardTheme.Transparent" parent="SetupWizardTheme">
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowIsFloating">true</item>
+        <item name="android:windowAnimationStyle">@null</item>
+    </style>
+
+    <style name="SetupWizardTheme.Light.Transparent" parent="SetupWizardTheme.Light">
+        <item name="android:windowBackground">@android:color/transparent</item>
+        <item name="android:windowNoTitle">true</item>
+        <item name="android:windowIsFloating">true</item>
+        <item name="android:windowAnimationStyle">@null</item>
+    </style>
+
     <style name="PreferenceThemeOverlay.SetupWizard" parent="PreferenceThemeOverlay.v14.Material">
         <item name="preferenceFragmentStyle">@style/SetupWizardPreferenceFragmentStyle</item>
     </style>
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java
index b7a2447..71501b1 100644
--- a/src/com/android/settings/SetupWizardUtils.java
+++ b/src/com/android/settings/SetupWizardUtils.java
@@ -41,6 +41,14 @@
         }
     }
 
+    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 9cadef9..b15a6e4 100644
--- a/src/com/android/settings/wifi/WifiDialogActivity.java
+++ b/src/com/android/settings/wifi/WifiDialogActivity.java
@@ -25,7 +25,9 @@
 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 @@
 
     @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) {