Bug 1130302 - Move ShareOverlayButton.Text to ShareOverlayTextAppearance.Button. r=mhaigh a=sylvestre
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 18 Mar 2015 16:22:15 -0700
changeset 258344 8691a7ac4c95
parent 258343 41eba60614f8
child 258345 b731c0df23aa
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
bugs1130302
milestone38.0
Bug 1130302 - Move ShareOverlayButton.Text to ShareOverlayTextAppearance.Button. r=mhaigh a=sylvestre It's good practice to separate TextAppearance from View attr.
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/resources/layout/overlay_share_button.xml
+++ b/mobile/android/base/resources/layout/overlay_share_button.xml
@@ -6,13 +6,14 @@
 <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:id="@+id/overlaybtn_icon"/>
 
     <TextView
-        style="@style/ShareOverlayButton.Text"
+        style="@style/ShareOverlayButton"
+        android:textAppearance="@style/ShareOverlayTextAppearance.Button"
         android:id="@+id/overlaybtn_label"
         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
@@ -20,26 +20,26 @@
         android:layout_gravity="bottom|center"
         android:paddingTop="8dp"
         android:orientation="vertical">
 
         <!-- Title -->
         <TextView
             android:id="@+id/title"
             style="@style/ShareOverlayTitle"
-            android:textAppearance="@style/ShareOverlayTextAppearance.Title"
+            android:textAppearance="@style/ShareOverlayTextAppearance.Header.Title"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_marginBottom="8dp"/>
 
         <!-- Subtitle (url) -->
         <TextView
             android:id="@+id/subtitle"
             style="@style/ShareOverlayTitle"
-            android:textAppearance="@style/ShareOverlayTextAppearance.Subtitle"
+            android:textAppearance="@style/ShareOverlayTextAppearance.Header.Subtitle"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"/>
 
         <!-- TODO: Add back drop shadow? -->
         <!-- Buttons -->
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
--- 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,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
-    style="@style/ShareOverlayButton.Text"
+    style="@style/ShareOverlayButton"
+    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,23 +23,25 @@
         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.Text"
+            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:drawablePadding="15dp"
             android:drawableLeft="@drawable/overlay_check"/>
 
         <!-- Evil separator -->
         <View
             android:id="@+id/overlay_toast_separator"
             android:layout_marginTop="15dp"
             android:layout_marginBottom="15dp"
             android:layout_height="match_parent"
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -778,53 +778,55 @@
 
     <style name="ShareOverlayTitle">
         <item name="android:gravity">center_horizontal</item>
         <item name="android:paddingLeft">15dp</item>
         <item name="android:paddingRight">15dp</item>
     </style>
 
     <style name="ShareOverlayTextAppearance">
-        <item name="android:textColor">@android:color/white</item>
         <item name="android:fontFamily">sans-serif</item>
     </style>
 
-    <style name="ShareOverlayTextAppearance.Title">
+    <style name="ShareOverlayTextAppearance.Header">
+        <item name="android:textColor">@android:color/white</item>
+    </style>
+
+    <style name="ShareOverlayTextAppearance.Header.Title">
         <item name="android:textSize">20sp</item>
         <item name="android:maxLines">2</item>
         <item name="android:ellipsize">end</item>
     </style>
 
-    <style name="ShareOverlayTextAppearance.Subtitle">
+    <style name="ShareOverlayTextAppearance.Header.Subtitle">
         <item name="android:textSize">12sp</item>
         <item name="android:scrollHorizontally">true</item>
     </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>
         <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: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/primary_text_selector</item>
-    </style>
-
-    <style name="ShareOverlayButton.Text.Container">
+    <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">