Bug 1061384: Colour tweaks for the share overlay. r=rnewman
authorChris Kitching <chriskitching@linux.com>
Tue, 02 Sep 2014 16:43:27 -0700
changeset 203236 b0c0a3322e3668ffd146954108e4fa443cf192cc
parent 203235 ed3c169b4fb6d4609557e0cdec792c2e5f612c05
child 203237 4d07ea9dab6e7673cd121317c6c9a0ea47fcde39
push id27424
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 19:35:53 +0000
treeherdermozilla-central@bfef88becbba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1061384
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061384: Colour tweaks for the share overlay. r=rnewman
mobile/android/base/overlays/ui/SendTabDeviceListArrayAdapter.java
mobile/android/base/overlays/ui/ShareDialog.java
mobile/android/base/resources/drawable/overlay_share_button_background.xml
mobile/android/base/resources/layout/overlay_share_dialog.xml
mobile/android/base/resources/layout/sync_list_item.xml
mobile/android/base/resources/values/colors.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/overlays/ui/SendTabDeviceListArrayAdapter.java
+++ b/mobile/android/base/overlays/ui/SendTabDeviceListArrayAdapter.java
@@ -31,18 +31,18 @@ public class SendTabDeviceListArrayAdapt
     private final SendTabTargetSelectedListener listener;
 
     private Collection<ParcelableClientRecord> records;
 
     // The AlertDialog to show in the event the record is pressed while in the SHOW_DEVICES state.
     // This will show the user a prompt to select a device from a longer list of devices.
     private AlertDialog dialog;
 
-    public SendTabDeviceListArrayAdapter(Context context, SendTabTargetSelectedListener aListener, int textViewResourceId) {
-        super(context, textViewResourceId);
+    public SendTabDeviceListArrayAdapter(Context context, SendTabTargetSelectedListener aListener) {
+        super(context, R.layout.overlay_share_send_tab_item);
 
         listener = aListener;
 
         // We do this manually and avoid multiple notifications when doing compound operations.
         setNotifyOnChange(false);
     }
 
     /**
--- a/mobile/android/base/overlays/ui/ShareDialog.java
+++ b/mobile/android/base/overlays/ui/ShareDialog.java
@@ -158,17 +158,17 @@ public class ShareDialog extends LocaleA
                 addToReadingList();
             }
         });
 
         // Send tab.
         SendTabList sendTabList = (SendTabList) findViewById(R.id.overlay_send_tab_btn);
 
         // Register ourselves as both the listener and the context for the Adapter.
-        SendTabDeviceListArrayAdapter adapter = new SendTabDeviceListArrayAdapter(this, this, R.layout.sync_list_item);
+        SendTabDeviceListArrayAdapter adapter = new SendTabDeviceListArrayAdapter(this, this);
         sendTabList.setAdapter(adapter);
         sendTabList.setSendTabTargetSelectedListener(this);
     }
 
     /**
      * Helper method to get an overlay service intent populated with the data held in this dialog.
      */
     private Intent getServiceIntent(ShareMethod.Type method) {
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/overlay_share_button_background.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  - This Source Code Form is subject to the terms of the Mozilla Public
+  - License, v. 2.0. If a copy of the MPL was not distributed with this
+  - file, You can obtain one at http://mozilla.org/MPL/2.0/.
+  -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_pressed="true" android:drawable="@color/overlay_share_selected" />
+    <item android:drawable="@color/overlay_share_background"/>
+
+</selector>
--- a/mobile/android/base/resources/layout/overlay_share_dialog.xml
+++ b/mobile/android/base/resources/layout/overlay_share_dialog.xml
@@ -25,17 +25,17 @@
         android:orientation="vertical"
         android:background="@drawable/share_overlay_background">
 
         <!-- Header -->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_margin="0dp"
-            android:background="@color/background_light"
+            android:background="@color/overlay_share_header_background"
             android:orientation="vertical"
             android:paddingTop="10dp"
             android:paddingBottom="15dp"
             android:paddingLeft="15dp"
             android:paddingRight="15dp"
             android:layout_gravity="center">
 
             <!-- Title -->
@@ -58,27 +58,26 @@
                 android:textColor="@color/text_color_secondary"/>
 
         </LinearLayout>
 
         <!-- Buttons -->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:background="@color/overlay_share_background_colour"
+            android:background="@color/overlay_share_background"
             android:orientation="vertical">
 
             <!-- TODO: Once API 11 is available, stick "showDividers=middle" into the parent and get rid
                        of these evil separator views. -->
 
             <!-- "Send to Firefox Sync" -->
             <org.mozilla.gecko.overlays.ui.SendTabList
                 style="@style/ShareOverlayButton"
                 android:id="@+id/overlay_send_tab_btn"
-                android:background="@color/overlay_share_background_colour"
                 android:padding="0dp"/>
 
             <!-- Evil separator -->
             <View
                 android:layout_width="match_parent"
                 android:layout_height="1dp"
                 android:background="@color/background_light"/>
 
--- a/mobile/android/base/resources/layout/sync_list_item.xml
+++ b/mobile/android/base/resources/layout/sync_list_item.xml
@@ -15,16 +15,17 @@
         android:id="@+id/img"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:padding="10dp"
         android:layout_marginRight="10dip" />
 
     <TextView
         android:id="@+id/client_name"
+        style="@style/ShareOverlayButton.Text"
         android:layout_gravity="center"
         android:layout_width="0dp"
         android:layout_weight="0.5"
         android:layout_height="wrap_content" />
 
     <CheckBox
         android:id="@+id/check"
         android:layout_width="40dp"
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -46,18 +46,21 @@
   <!-- Default inverse colors -->
   <color name="text_color_primary_inverse">#FFFFFF</color>
   <color name="text_color_secondary_inverse">#DDDDDD</color>
   <color name="text_color_tertiary_inverse">#A4A7A9</color>
 
   <!-- Colour used for share overlay button labels -->
   <color name="text_color_overlaybtn">#666666</color>
 
-  <!-- Colour used for share overlay button background -->
-  <color name="overlay_share_background_colour">#FFD0CECB</color>
+  <color name="overlay_share_header_background">#FFFFFFFF</color>
+
+  <!-- Colours used for share overlay button background -->
+  <color name="overlay_share_background">#FFEBEBF0</color>
+  <color name="overlay_share_selected">#FFF5F5F5</color>
 
   <!-- Disabled colors -->
   <color name="text_color_primary_disable_only">#999999</color>
 
   <!-- Hint colors -->
   <color name="text_color_hint">#666666</color>
   <color name="text_color_hint_inverse">#7F828A</color>
   <color name="text_color_hint_floating_focused">#33b5e5</color>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -767,17 +767,17 @@
         <item name="android:minHeight">60dp</item>
         <item name="android:gravity">center_vertical</item>
         <item name="android:paddingLeft">15dp</item>
         <item name="android:paddingRight">15dp</item>
         <item name="android:paddingTop">17dp</item>
         <item name="android:paddingBottom">17dp</item>
         <item name="android:focusableInTouchMode">false</item>
         <item name="android:clickable">true</item>
-        <item name="android:background">@android:drawable/list_selector_background</item>
+        <item name="android:background">@drawable/overlay_share_button_background</item>
         <item name="android:layout_margin">0dp</item>
     </style>
 
     <style name="ShareOverlayButton.Text">
         <item name="android:drawablePadding">15dp</item>
         <item name="android:maxLines">1</item>
         <item name="android:textSize">14sp</item>
         <item name="android:textColor">@color/text_color_overlaybtn</item>