Bug 1193975 - Remove NewTablet from ImageButton style. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 12 Aug 2015 16:24:18 -0700
changeset 292001 33890bfdc26d841480c42d8a7cdd334916fd07f3
parent 292000 9820ec4471422110d8319c8fb109946ed1b0ea8a
child 292002 9b6e54ff3cb3e3cc093114652d8bbd99baf27141
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1193975
milestone43.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 1193975 - Remove NewTablet from ImageButton style. r=mhaigh I feel like there's a better way to do this than using *Base, but this is our current convention.
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/values-large-v11/styles.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -51,17 +51,17 @@
             android:src="@drawable/ic_menu_forward"
             android:background="@drawable/url_bar_nav_button"
             android:alpha="0"
             android:layout_width="@dimen/new_tablet_nav_button_width_plus_half"
             android:layout_marginLeft="@dimen/new_tablet_nav_button_width_half"
             android:paddingLeft="18dp"/>
 
     <org.mozilla.gecko.toolbar.BackButton android:id="@id/back"
-                                          style="@style/UrlBar.ImageButton.NewTablet"
+                                          style="@style/UrlBar.ImageButton"
                                           android:layout_width="@dimen/new_tablet_nav_button_width"
                                           android:layout_height="@dimen/new_tablet_nav_button_width"
                                           android:layout_centerVertical="true"
                                           android:layout_marginLeft="12dp"
                                           android:layout_alignParentLeft="true"
                                           android:src="@drawable/ic_menu_back"
                                           android:contentDescription="@string/back"
                                           android:background="@drawable/url_bar_nav_button"/>
@@ -87,17 +87,17 @@
                   android:layout_height="match_parent"
                   android:gravity="center_vertical"
                   android:layout_marginLeft="6dp"
                   android:orientation="horizontal"
                   android:layout_toLeftOf="@id/tabs"/>
 
     <org.mozilla.gecko.widget.ThemedImageButton
             android:id="@+id/tabs"
-            style="@style/UrlBar.ImageButton.NewTablet"
+            style="@style/UrlBar.ImageButton"
             android:layout_toLeftOf="@id/menu"
             android:layout_alignWithParentIfMissing="true"
             android:background="@drawable/browser_toolbar_action_bar_button"/>
 
     <!-- In a 56x60dp space, centering 24dp image will leave 16x18dp. -->
     <org.mozilla.gecko.toolbar.TabCounter android:id="@+id/tabs_counter"
                         style="@style/UrlBar.ImageButton.TabCount.NewTablet"
                         android:layout_alignLeft="@id/tabs"
@@ -106,26 +106,26 @@
                         android:layout_alignBottom="@id/tabs"
                         android:layout_marginTop="18dp"
                         android:layout_marginBottom="18dp"
                         android:layout_marginLeft="16dp"
                         android:layout_marginRight="16dp"/>
 
     <org.mozilla.gecko.widget.ThemedImageButton
             android:id="@+id/menu"
-            style="@style/UrlBar.ImageButton.NewTablet"
+            style="@style/UrlBar.ImageButton"
             android:layout_alignParentRight="true"
             android:layout_marginRight="6dp"
             android:contentDescription="@string/menu"
             android:background="@drawable/browser_toolbar_action_bar_button"
             android:visibility="gone"/>
 
     <org.mozilla.gecko.widget.ThemedImageView
             android:id="@+id/menu_icon"
-            style="@style/UrlBar.ImageButton.NewTablet"
+            style="@style/UrlBar.ImageButton"
             android:layout_alignLeft="@id/menu"
             android:layout_alignRight="@id/menu"
             android:src="@drawable/tablet_menu"
             android:visibility="gone"/>
 
     <!-- We draw after the menu items so when they are hidden, the cancel button,
          which is thus drawn on top, may be pressed. -->
     <org.mozilla.gecko.widget.ThemedImageView
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -1,24 +1,21 @@
 <?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/. -->
 
 <resources>
 
-    <style name="UrlBar.ImageButton.NewTablet">
+    <style name="UrlBar.ImageButton" parent="UrlBar.ImageButtonBase">
         <item name="android:layout_width">@dimen/new_tablet_browser_toolbar_menu_item_width</item>
     </style>
 
     <style name="UrlBar.ImageButton.TabCount.NewTablet">
         <item name="android:background">@drawable/tabs_count</item>
-
-        <!-- From UrlBar.ImageButton.NewTablet because we can't inherit directly. -->
-        <item name="android:layout_width">@dimen/new_tablet_browser_toolbar_menu_item_width</item>
     </style>
 
     <style name="UrlBar.Button.Container">
         <item name="android:layout_marginTop">6dp</item>
         <item name="android:layout_marginBottom">6dp</item>
         <!-- Start with forward hidden -->
         <item name="android:orientation">horizontal</item>
     </style>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -473,23 +473,26 @@
         <item name="android:textSelectHandleRight">@drawable/handle_end</item>
         <item name="android:textCursorDrawable">@null</item>
         <item name="android:singleLine">true</item>
         <item name="android:gravity">center_vertical|left</item>
         <item name="android:hint">@string/url_bar_default_text</item>
     </style>
 
     <!-- URL bar - Image Button -->
-    <style name="UrlBar.ImageButton" parent="UrlBar.Button">
-        <item name="android:layout_width">@dimen/browser_toolbar_height</item>
+    <style name="UrlBar.ImageButtonBase" parent="UrlBar.Button">
         <item name="android:scaleType">center</item>
         <item name="android:layout_gravity">center_vertical</item>
         <item name="android:background">@android:color/transparent</item>
     </style>
 
+    <style name="UrlBar.ImageButton" parent="UrlBar.ImageButtonBase">
+        <item name="android:layout_width">@dimen/browser_toolbar_height</item>
+    </style>
+
     <!-- URL bar - Image Button - Icon -->
     <style name="UrlBar.ImageButton.Icon">
          <item name="android:layout_width">@dimen/browser_toolbar_icon_width</item>
          <item name="android:layout_height">@dimen/browser_toolbar_height</item>
          <item name="android:layout_weight">0.0</item>
     </style>
 
     <!-- TabsLayout -->