Bug 1130203 - Clean up style inheritance in share overlay. r=mhaigh a=sylvestre
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 18 Mar 2015 16:59:18 -0700
changeset 258347 49441819b75a
parent 258346 1c2ce96f9359
child 258348 f2cbe1ec6d5a
push id4648
push usermichael.l.comella@gmail.com
push date2015-04-08 16:26 +0000
treeherdermozilla-beta@e399294c9df3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh, sylvestre
bugs1130203
milestone38.0
Bug 1130203 - Clean up style inheritance in share overlay. r=mhaigh a=sylvestre
mobile/android/base/overlays/ui/OverlayDialogButton.java
mobile/android/base/resources/layout/overlay_share_button.xml
mobile/android/base/resources/layout/overlay_share_dialog.xml
mobile/android/base/resources/layout/overlay_share_send_tab_item.xml
mobile/android/base/resources/layout/overlay_share_toast.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/overlays/ui/OverlayDialogButton.java
+++ b/mobile/android/base/overlays/ui/OverlayDialogButton.java
@@ -50,16 +50,18 @@ public class OverlayDialogButton extends
 
     public OverlayDialogButton(Context context) {
         this(context, null);
     }
 
     public OverlayDialogButton(Context context, AttributeSet attrs) {
         super(context, attrs);
 
+        setOrientation(LinearLayout.HORIZONTAL);
+
         LayoutInflater.from(context).inflate(R.layout.overlay_share_button, this);
 
         icon = (ImageView) findViewById(R.id.overlaybtn_icon);
         label = (TextView) findViewById(R.id.overlaybtn_label);
     }
 
     public void setEnabledLabelAndIcon(String s, Drawable d) {
         enabledLabel = s;
--- a/mobile/android/base/resources/layout/overlay_share_button.xml
+++ b/mobile/android/base/resources/layout/overlay_share_button.xml
@@ -3,17 +3,19 @@
    - 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/. -->
 
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
     <ImageView
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:paddingLeft="15dp"
+        android:paddingRight="15dp"
         android:id="@+id/overlaybtn_icon"/>
 
     <TextView
-        style="@style/ShareOverlayButton"
         android:textAppearance="@style/ShareOverlayTextAppearance.Button"
         android:id="@+id/overlaybtn_label"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
         android:clickable="false"
         android:enabled="false"/>
 </merge>
--- a/mobile/android/base/resources/layout/overlay_share_dialog.xml
+++ b/mobile/android/base/resources/layout/overlay_share_dialog.xml
@@ -38,30 +38,33 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginBottom="20dp"/>
 
         <!-- TODO: Add back drop shadow? -->
         <!-- Buttons -->
         <!-- "Send to Firefox Sync" -->
         <org.mozilla.gecko.overlays.ui.SendTabList
-            style="@style/ShareOverlayButton"
             android:id="@+id/overlay_send_tab_btn"
-            android:padding="0dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical"
             android:divider="@null"/>
 
         <!-- "Add to reading list" -->
         <org.mozilla.gecko.overlays.ui.OverlayDialogButton
-            style="@style/ShareOverlayButton.Text.Container"
+            style="@style/ShareOverlayRow"
             android:id="@+id/overlay_share_reading_list_btn"
-            android:background="@drawable/overlay_share_button_background"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
             android:enabled="false"/>
 
         <!-- "Add bookmark" -->
         <org.mozilla.gecko.overlays.ui.OverlayDialogButton
-            style="@style/ShareOverlayButton.Text.Container"
+            style="@style/ShareOverlayRow"
             android:id="@+id/overlay_share_bookmark_btn"
-            android:background="@drawable/overlay_share_button_background"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
             android:enabled="false"/>
 
     </LinearLayout>
 
 </FrameLayout>
--- a/mobile/android/base/resources/layout/overlay_share_send_tab_item.xml
+++ b/mobile/android/base/resources/layout/overlay_share_send_tab_item.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/ShareOverlayButton"
+    style="@style/ShareOverlayRow"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
     android:textAppearance="@style/ShareOverlayTextAppearance.Button"
-    android:background="@drawable/overlay_share_button_background"
     android:clickable="true"/>
--- a/mobile/android/base/resources/layout/overlay_share_toast.xml
+++ b/mobile/android/base/resources/layout/overlay_share_toast.xml
@@ -23,24 +23,28 @@
         android:orientation="horizontal"
         android:paddingLeft="5dp"
         android:paddingRight="10dp"
         android:paddingTop="5dp"
         android:paddingBottom="5dp">
 
         <!-- Large attractive green tick with label to the right -->
         <TextView
-            style="@style/ShareOverlayButton"
             android:textAppearance="@style/ShareOverlayTextAppearance.Button"
             android:id="@+id/overlay_toast_message"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:maxLines="1"
             android:textColor="@color/text_color_primary"
             android:textSize="14sp"
+            android:minHeight="60dp"
+            android:paddingLeft="15dp"
+            android:paddingRight="15dp"
+            android:paddingTop="17dp"
+            android:paddingBottom="17dp"
             android:drawablePadding="15dp"
             android:drawableLeft="@drawable/overlay_check"/>
 
         <!-- Evil separator -->
         <View
             android:id="@+id/overlay_toast_separator"
             android:layout_marginTop="15dp"
             android:layout_marginBottom="15dp"
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -802,34 +802,21 @@
     </style>
 
     <style name="ShareOverlayTextAppearance.Button">
         <item name="android:maxLines">1</item>
         <item name="android:textSize">14sp</item>
         <item name="android:textColor">@color/primary_text_selector</item>
     </style>
 
-    <!-- TODO: Clean up this and inherited styles. -->
-    <style name="ShareOverlayButton">
-        <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">wrap_content</item>
+    <style name="ShareOverlayRow">
         <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:background">@drawable/overlay_share_button_background</item>
         <item name="android:focusableInTouchMode">false</item>
-        <item name="android:layout_margin">0dp</item>
-    </style>
-
-    <style name="ShareOverlayButton.Text.Container" parent="ShareOverlayButton">
-        <item name="android:padding">0dp</item>
-        <item name="android:orientation">horizontal</item>
-        <item name="android:background">@drawable/overlay_share_button_background</item>
     </style>
 
     <style name="TabInput"></style>
 
     <style name="TabInput.TabWidget">
         <item name="android:divider">@drawable/divider_vertical</item>
         <item name="android:background">@drawable/tab_indicator_background</item>
     </style>