Bug 1150742 - Move once-used forward button style to use in layout. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Tue, 11 Aug 2015 16:29:25 -0700
changeset 257610 18518f819dbab607d3d9cb5145622efdba89f481
parent 257609 cf92c63365bc538804f8fd05eb1866574f998202
child 257611 d5a72977964694c27a4ffa4d37d2a21237066158
push id14649
push usermichael.l.comella@gmail.com
push dateThu, 13 Aug 2015 17:29:23 +0000
treeherderfx-team@03b4d313d6d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1150742
milestone43.0a1
Bug 1150742 - Move once-used forward button style to use in layout. r=mhaigh When styles are only used once, there is no need to clutter up the styles files for them.
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/values-large-v11/styles.xml
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -14,19 +14,51 @@
                android:layout_marginLeft="@dimen/new_tablet_nav_button_width_half"
                android:layout_marginTop="10dp"
                android:layout_marginBottom="10dp"
                android:duplicateParentState="true"
                android:clickable="false"
                android:focusable="false"
                android:background="@drawable/url_bar_entry"/>
 
-    <org.mozilla.gecko.toolbar.ForwardButton style="@style/UrlBar.ImageButton.Forward"
-                                             android:id="@+id/forward"
-                                             android:layout_alignLeft="@id/back"/>
+    <!-- The attributes statically defined here are for the expanded
+         forward button. We translate/hide the forward button in code -
+         see BrowserToolbarTablet.animateForwardButton.
+
+         (for alpha) We want the button hidden to start so alpha=0.
+
+         (for layout_width) The visible area of the forward button is a
+	     nav_button_width and the non-visible area slides halfway
+	     under the back button. This non-visible area is used to
+	     ensure the forward button background fully covers the space
+	     to the right of the back button.
+
+         (for layout_marginLeft) We left align with back,
+         but only need to hide halfway underneath.
+
+         (for paddingLeft) We use left padding to center the
+         arrow in the visible area as opposed to the true width. -->
+    <org.mozilla.gecko.toolbar.ForwardButton
+            style="@style/UrlBar.ImageButton"
+            android:id="@+id/forward"
+            android:layout_alignLeft="@id/back"
+            android:contentDescription="@string/forward"
+            android:layout_height="match_parent"
+            android:paddingTop="0dp"
+            android:paddingBottom="0dp"
+            android:layout_marginTop="11.5dp"
+            android:layout_marginBottom="11.5dp"
+            android:layout_gravity="center_vertical"
+            android:layout_centerVertical="true"
+            android:src="@drawable/new_tablet_ic_menu_forward"
+            android:background="@drawable/new_tablet_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"
                                           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"
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -4,48 +4,16 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <style name="UrlBar.ImageButton.NewTablet">
         <item name="android:layout_width">@dimen/new_tablet_browser_toolbar_menu_item_width</item>
     </style>
 
-    <!-- Note: this style is for the visible and expanded forward button.  We translate/hide
-         the forward button in code - see BrowserToolbarNewTablet.animateForwardButton. -->
-    <style name="UrlBar.ImageButton.Forward">
-        <item name="android:contentDescription">@string/forward</item>
-        <item name="android:layout_height">match_parent</item>
-        <item name="android:paddingTop">0dp</item>
-        <item name="android:paddingBottom">0dp</item>
-        <item name="android:layout_marginTop">11.5dp</item>
-        <item name="android:layout_marginBottom">11.5dp</item>
-        <item name="android:layout_gravity">center_vertical</item>
-        <item name="android:layout_centerVertical">true</item>
-        <item name="android:src">@drawable/new_tablet_ic_menu_forward</item>
-        <item name="android:background">@drawable/new_tablet_url_bar_nav_button</item>
-
-        <!-- Start with the button hidden -->
-        <item name="android:alpha">0</item>
-
-        <!-- The visible area of the forward button is a nav_button_width and the
-             non-visible area slides halfway under the back button. This non-visible
-             area is used to ensure the forward button background fully
-             covers the space to the right of the back button. -->
-        <item name="android:layout_width">@dimen/new_tablet_nav_button_width_plus_half</item>
-
-        <!-- (See note above) We left align with back,
-             but only need to hide halfway underneath. -->
-        <item name="android:layout_marginLeft">@dimen/new_tablet_nav_button_width_half</item>
-
-        <!-- We use left padding to center the arrow in the
-             visible area as opposed to the true width. -->
-        <item name="android:paddingLeft">18dp</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">