Bug 1132986 - Display a Gecko-themed dialog when sending tabs to device. r=liuche, a=lmandel
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 25 Feb 2015 17:48:13 -0800
changeset 250237 003b419b893f
parent 250236 729cf69ef43f
child 250238 41929a7c55f5
push id4524
push userryanvm@gmail.com
push date2015-03-04 18:49 +0000
treeherdermozilla-beta@666a1aafecfd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, lmandel
bugs1132986
milestone37.0
Bug 1132986 - Display a Gecko-themed dialog when sending tabs to device. r=liuche, a=lmandel
mobile/android/base/overlays/ui/SendTabList.java
mobile/android/base/resources/values-v11/themes.xml
--- a/mobile/android/base/overlays/ui/SendTabList.java
+++ b/mobile/android/base/overlays/ui/SendTabList.java
@@ -5,16 +5,17 @@
 package org.mozilla.gecko.overlays.ui;
 
 import static org.mozilla.gecko.overlays.ui.SendTabList.State.LIST;
 import static org.mozilla.gecko.overlays.ui.SendTabList.State.LOADING;
 import static org.mozilla.gecko.overlays.ui.SendTabList.State.SHOW_DEVICES;
 
 import java.util.Arrays;
 
+import org.mozilla.gecko.AppConstants.Versions;
 import org.mozilla.gecko.Assert;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.Telemetry;
 import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.overlays.service.sharemethods.ParcelableClientRecord;
 
 import android.app.AlertDialog;
 import android.content.Context;
@@ -125,17 +126,24 @@ public class SendTabList extends ListVie
     }
 
     /**
      * Get an AlertDialog listing all devices, allowing the user to select the one they want.
      * Used when more than MAXIMUM_INLINE_ELEMENTS devices are found (to avoid displaying them all
      * inline and looking crazy).
      */
     public AlertDialog getDialog() {
-        AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
+        final Context context = getContext();
+
+        final AlertDialog.Builder builder;
+        if (Versions.feature11Plus) {
+            builder = new AlertDialog.Builder(context, R.style.Gecko_Dialog);
+        } else {
+            builder = new AlertDialog.Builder(context);
+        }
 
         final ParcelableClientRecord[] records = clientListAdapter.toArray();
         final String[] dialogElements = new String[records.length];
 
         for (int i = 0; i < records.length; i++) {
             dialogElements[i] = records[i].name;
         }
 
--- a/mobile/android/base/resources/values-v11/themes.xml
+++ b/mobile/android/base/resources/values-v11/themes.xml
@@ -15,16 +15,17 @@
         <item name="android:windowNoTitle">true</item>
         <item name="arrowPopupWidth">match_parent</item>
     </style>
 
     <style name="GeckoDialogBase" parent="@android:style/Theme.Holo.Light.Dialog">
         <item name="android:windowContentOverlay">@null</item>
         <item name="android:windowActionBar">false</item>
         <item name="android:windowNoTitle">true</item>
+        <item name="android:windowBackground">@android:color/transparent</item>
     </style>
 
     <style name="GeckoTitleDialogBase" parent="@android:style/Theme.Holo.Light.Dialog" />
 
     <style name="GeckoPreferencesBase" parent="GeckoBase">
         <item name="android:windowActionBar">true</item>
         <item name="android:windowNoTitle">false</item>
         <item name="android:actionBarStyle">@style/ActionBar.GeckoPreferences</item>