Bug 1130302 - Move ShareOverlayButton.Text to ShareOverlayTextAppearance.Button. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 18 Mar 2015 16:22:15 -0700
changeset 264371 54b0e2df669c9597ade78ad6afebb3ea8ffd2850
parent 264370 3fefbfbc7e5152dceb35220645f93eb2738e3868
child 264372 cd8b1c84f1ea626610a773374c87678dbfc03cde
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1130302
milestone39.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 1130302 - Move ShareOverlayButton.Text to ShareOverlayTextAppearance.Button. r=mhaigh 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/placeholder_active_grey"
             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
@@ -780,53 +780,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">