Bug 681805 - Move forward button styling to style files. r=lucasr
☠☠ backed out by a6c22df81869 ☠ ☠
authorWes Johnston <wjohnston@mozilla.com>
Wed, 19 Dec 2012 09:28:59 -0800
changeset 125698 47debf3f344cd1feff97922f59a35466c6d9d1a0
parent 125697 e48db20a0a46fe1b72f1c81ebc96dd94fac20560
child 125699 06d72606ec56ce8c151b30fe157d2bc567c7d87a
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs681805
milestone20.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 681805 - Move forward button styling to style files. r=lucasr
mobile/android/base/resources/layout-land-v14/browser_toolbar.xml.in
mobile/android/base/resources/layout-land-v14/browser_toolbar_menu.xml.in
mobile/android/base/resources/layout-large-v11/browser_toolbar_menu.xml.in
mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
mobile/android/base/resources/layout/browser_toolbar.xml.in
mobile/android/base/resources/layout/browser_toolbar_menu.xml.in
mobile/android/base/resources/values-large-v11/dimens.xml
mobile/android/base/resources/values-large-v11/styles.xml
mobile/android/base/resources/values-xlarge-v11/dimens.xml
mobile/android/base/resources/values/dimens.xml
mobile/android/base/resources/values/styles.xml
--- a/mobile/android/base/resources/layout-land-v14/browser_toolbar.xml.in
+++ b/mobile/android/base/resources/layout-land-v14/browser_toolbar.xml.in
@@ -11,34 +11,29 @@
 
     <RelativeLayout android:id="@+id/address_bar"
                     style="@style/AddressBar">
 
         <ImageButton android:id="@+id/back"
                      android:contentDescription="@string/back"
                      style="@style/AddressBar.ImageButton.Unused"/>
 
-        <ImageButton android:id="@+id/forward"
-                     android:contentDescription="@string/forward"
-                     style="@style/AddressBar.ImageButton.Unused"/>
+        <ImageButton style="@style/AddressBar.ImageButton.Forward"
+                     android:id="@+id/forward"/>
 
         <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
                                                     android:layout_width="fill_parent"
                                                     android:layout_height="fill_parent"
                                                     android:layout_marginRight="14dip"
                                                     android:layout_alignParentTop="true"
                                                     android:layout_alignParentRight="true"
                                                     android:background="@drawable/address_bar_bg"/>
 
-        <FrameLayout style="@style/AddressBar.Button"
-                     android:layout_marginLeft="4dp"
-                     android:layout_marginRight="4dp"
-                     android:layout_alignParentLeft="true"
-                     android:layout_alignParentBottom="true"
-                     android:layout_centerVertical="true">
+         <FrameLayout style="@style/AddressBar.Button.Container"
+                      android:id="@+id/addressbar">
 
             <Gecko.RelativeLayout android:id="@+id/awesome_bar"
                                   style="@style/AddressBar.Button"
                                   android:layout_centerVertical="true"
                                   android:clickable="true"
                                   android:focusable="true">
 
                 <ImageView android:id="@+id/awesome_bar_entry"
--- a/mobile/android/base/resources/layout-land-v14/browser_toolbar_menu.xml.in
+++ b/mobile/android/base/resources/layout-land-v14/browser_toolbar_menu.xml.in
@@ -11,34 +11,29 @@
 
     <RelativeLayout android:id="@+id/address_bar"
                     style="@style/AddressBar">
 
         <ImageButton android:id="@+id/back"
                      android:contentDescription="@string/back"
                      style="@style/AddressBar.ImageButton.Unused"/>
 
-        <ImageButton android:id="@+id/forward"
-                     android:contentDescription="@string/forward"
-                     style="@style/AddressBar.ImageButton.Unused"/>
+        <ImageButton style="@style/AddressBar.ImageButton.Forward"
+                     android:id="@+id/forward"/>
 
         <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
                                                     android:layout_width="fill_parent"
                                                     android:layout_height="fill_parent"
                                                     android:layout_marginRight="50dip"
                                                     android:layout_alignParentTop="true"
                                                     android:layout_alignParentRight="true"
                                                     android:background="@drawable/address_bar_bg"/>
         
-        <FrameLayout style="@style/AddressBar.Button"
-                     android:layout_marginLeft="4dp"
-                     android:layout_marginRight="4dp"
-                     android:layout_alignParentLeft="true"
-                     android:layout_alignParentBottom="true"
-                     android:layout_centerVertical="true">
+        <FrameLayout style="@style/AddressBar.Button.Container"
+                     android:id="@+id/addressbar">
 
             <Gecko.RelativeLayout android:id="@+id/awesome_bar"
                                   style="@style/AddressBar.Button"
                                   android:layout_centerVertical="true"
                                   android:clickable="true"
                                   android:focusable="true">
 
                 <ImageView android:id="@+id/awesome_bar_entry"
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar_menu.xml.in
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar_menu.xml.in
@@ -64,43 +64,31 @@
                                android:clickable="false"
                                android:focusable="false"
                                android:src="@drawable/address_bar_url"/>
 
                 </view>
 
             </Gecko.RelativeLayout>
 
-            <org.mozilla.gecko.ForwardButton android:id="@+id/forward"
-                                             style="@style/AddressBar.ImageButton"
-                                             android:layout_width="64dip"
-                                             android:layout_height="42dip"
-                                             android:layout_marginLeft="21dp"
-                                             android:paddingLeft="21dp"
-                                             android:layout_gravity="center_vertical"
-                                             android:src="@drawable/ic_menu_forward"
-                                             android:contentDescription="@string/forward"
-                                             android:background="@drawable/address_bar_nav_button"/>
+            <org.mozilla.gecko.ForwardButton style="@style/AddressBar.ImageButton.Forward"
+                                             android:id="@+id/forward"/>
 
             <org.mozilla.gecko.BackButton android:id="@+id/back"
                                           style="@style/AddressBar.ImageButton"
                                           android:layout_width="50dip"
                                           android:layout_height="50dip"
                                           android:layout_marginLeft="1dp"
                                           android:layout_gravity="center_vertical"
                                           android:src="@drawable/ic_menu_back"
                                           android:contentDescription="@string/back"
                                           android:background="@drawable/address_bar_nav_button"/>
 
-            <LinearLayout style="@style/AddressBar.Button"
-                          android:layout_marginLeft="90dp"
-                          android:layout_marginTop="6dp"
-                          android:layout_marginBottom="6dp"
-                          android:layout_marginRight="0dp"
-                          android:orientation="horizontal">
+            <LinearLayout style="@style/AddressBar.Button.Container"
+                          android:id="@+id/addressbar">
 
                 <ImageButton android:id="@+id/favicon"
                              style="@style/AddressBar.ImageButton"
                              android:layout_width="@dimen/browser_toolbar_favicon_size"
                              android:layout_height="fill_parent"
                              android:scaleType="fitCenter"
                              android:paddingLeft="8dip"
                              android:layout_marginRight="4dip"
--- a/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
+++ b/mobile/android/base/resources/layout-xlarge-v11/browser_toolbar_menu.xml.in
@@ -99,42 +99,30 @@
                                      android:clickable="false"
                                      android:focusable="false"
                                      android:src="@drawable/address_bar_url"/>
 
                 </view>
 
             </Gecko.RelativeLayout>
 
-            <org.mozilla.gecko.ForwardButton android:id="@+id/forward"
-                                             style="@style/AddressBar.ImageButton"
-                                             android:layout_width="64dip"
-                                             android:layout_height="42dip"
-                                             android:layout_marginLeft="22dp"
-                                             android:paddingLeft="22dp"
-                                             android:layout_centerVertical="true"
-                                             android:src="@drawable/ic_menu_forward"
-                                             android:contentDescription="@string/forward"
-                                             android:background="@drawable/address_bar_nav_button"/>
+            <org.mozilla.gecko.ForwardButton style="@style/AddressBar.ImageButton.Forward"
+                                             android:id="@+id/forward"/>
 
             <org.mozilla.gecko.BackButton android:id="@+id/back"
                                           style="@style/AddressBar.ImageButton"
                                           android:layout_width="50dip"
                                           android:layout_height="50dip"
                                           android:layout_centerVertical="true"
                                           android:src="@drawable/ic_menu_back"
                                           android:contentDescription="@string/back"
                                           android:background="@drawable/address_bar_nav_button"/>
 
-            <LinearLayout style="@style/AddressBar.Button"
-                          android:layout_marginLeft="84dp"
-                          android:layout_marginTop="6dp"
-                          android:layout_marginBottom="6dp"
-                          android:layout_marginRight="0dp"
-                          android:orientation="horizontal">
+            <LinearLayout style="@style/AddressBar.Button.Container"
+                          android:id="@+id/addressbar">
 
                 <ImageButton android:id="@+id/favicon"
                              style="@style/AddressBar.ImageButton"
                              android:layout_width="@dimen/browser_toolbar_favicon_size"
                              android:layout_height="fill_parent"
                              android:scaleType="fitCenter"
                              android:paddingLeft="8dip"
                              android:layout_marginRight="4dip"
--- a/mobile/android/base/resources/layout/browser_toolbar.xml.in
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml.in
@@ -11,34 +11,29 @@
 
     <RelativeLayout android:id="@+id/address_bar"
                     style="@style/AddressBar">
 
         <ImageButton android:id="@+id/back"
                      android:contentDescription="@string/back"
                      style="@style/AddressBar.ImageButton.Unused"/>
 
-        <ImageButton android:id="@+id/forward"
-                     android:contentDescription="@string/forward"
-                     style="@style/AddressBar.ImageButton.Unused"/>
+        <ImageButton style="@style/AddressBar.ImageButton.Forward"
+                     android:id="@+id/forward"/>
 
         <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
                                                     android:layout_width="fill_parent"
                                                     android:layout_height="fill_parent"
                                                     android:layout_marginRight="17dip"
                                                     android:layout_alignParentTop="true"
                                                     android:layout_alignParentRight="true"
                                                     android:background="@drawable/address_bar_bg"/>
 
-        <FrameLayout style="@style/AddressBar.Button"
-                     android:layout_marginLeft="4dp"
-                     android:layout_marginRight="4dp"
-                     android:layout_alignParentLeft="true"
-                     android:layout_alignParentBottom="true"
-                     android:layout_centerVertical="true">
+        <FrameLayout style="@style/AddressBar.Button.Container"
+                     android:id="@+id/addressbar">
 
             <Gecko.RelativeLayout android:id="@+id/awesome_bar"
                                   style="@style/AddressBar.Button"
                                   android:layout_centerVertical="true"
                                   android:clickable="true"
                                   android:focusable="true">
 
                 <ImageView android:id="@+id/awesome_bar_entry"
--- a/mobile/android/base/resources/layout/browser_toolbar_menu.xml.in
+++ b/mobile/android/base/resources/layout/browser_toolbar_menu.xml.in
@@ -11,34 +11,29 @@
 
     <RelativeLayout android:id="@+id/address_bar"
                     style="@style/AddressBar">
 
         <ImageButton android:id="@+id/back"
                      android:contentDescription="@string/back"
                      style="@style/AddressBar.ImageButton.Unused"/>
 
-        <ImageButton android:id="@+id/forward"
-                     android:contentDescription="@string/forward"
-                     style="@style/AddressBar.ImageButton.Unused"/>
+        <ImageButton style="@style/AddressBar.ImageButton.Forward"
+                     android:id="@+id/forward"/>
 
         <org.mozilla.gecko.BrowserToolbarBackground android:id="@+id/address_bar_bg"
                                                     android:layout_width="fill_parent"
                                                     android:layout_height="fill_parent"
                                                     android:layout_marginRight="64dip"
                                                     android:layout_alignParentTop="true"
                                                     android:layout_alignParentRight="true"
                                                     android:background="@drawable/address_bar_bg"/>
 
-        <FrameLayout style="@style/AddressBar.Button"
-                     android:layout_marginLeft="4dp"
-                     android:layout_marginRight="4dp"
-                     android:layout_alignParentLeft="true"
-                     android:layout_alignParentBottom="true"
-                     android:layout_centerVertical="true">
+        <FrameLayout style="@style/AddressBar.Button.Container"
+                     android:id="@+id/addressbar">
 
             <Gecko.RelativeLayout android:id="@+id/awesome_bar"
                                   style="@style/AddressBar.Button"
                                   android:layout_centerVertical="true"
                                   android:clickable="true"
                                   android:focusable="true">
 
                 <ImageView android:id="@+id/awesome_bar_entry"
--- a/mobile/android/base/resources/values-large-v11/dimens.xml
+++ b/mobile/android/base/resources/values-large-v11/dimens.xml
@@ -4,10 +4,11 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <resources>
 
     <dimen name="browser_toolbar_height">56dp</dimen>
     <dimen name="browser_toolbar_icon_width">45dp</dimen>
     <dimen name="menu_popup_arrow_margin">8dip</dimen>
     <dimen name="tabs_counter_size">26sp</dimen>
+    <dimen name="addressbar_offset_left">90dp</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values-large-v11/styles.xml
+++ b/mobile/android/base/resources/values-large-v11/styles.xml
@@ -26,9 +26,29 @@
       <item name="android:listSelector">@drawable/action_bar_button</item>
       <item name="android:paddingTop">0dip</item>
       <item name="android:paddingBottom">0dip</item>
       <!-- Increase the padding on left and right on large screen sizes -->
       <item name="android:paddingLeft">60dip</item>
       <item name="android:paddingRight">60dip</item>
     </style>
 
+    <style name="AddressBar.ImageButton.Forward">
+        <item name="android:contentDescription">@string/forward</item>
+        <item name="android:layout_width">64dip</item>
+        <item name="android:layout_height">42dip</item>
+        <item name="android:layout_marginLeft">21dp</item>
+        <item name="android:paddingLeft">21dp</item>
+        <item name="android:layout_gravity">center_vertical</item>
+        <item name="android:layout_centerVertical">true</item>
+        <item name="android:src">@drawable/ic_menu_forward</item>
+        <item name="android:background">@drawable/address_bar_nav_button</item>
+    </style>
+
+   <style name="AddressBar.Button.Container">
+        <item name="android:layout_marginTop">6dp</item>
+        <item name="android:layout_marginBottom">6dp</item>
+        <item name="android:layout_marginRight">0dp</item>
+        <item name="android:layout_marginLeft">@dimen/addressbar_offset_left</item>
+        <item name="android:orientation">horizontal</item>
+    </style>
+
 </resources>
--- a/mobile/android/base/resources/values-xlarge-v11/dimens.xml
+++ b/mobile/android/base/resources/values-xlarge-v11/dimens.xml
@@ -11,10 +11,11 @@
     <dimen name="awesomebar_header_row_height">24dp</dimen>
     <dimen name="awesomebar_row_height">66dp</dimen>
     <dimen name="awesomebar_tab_transparency_height">46dp</dimen>
     <dimen name="browser_toolbar_height">56dp</dimen>
     <dimen name="local_tab_row_height">150dp</dimen>
     <dimen name="remote_tab_child_row_height">48dp</dimen>
     <dimen name="remote_tab_group_row_height">28dp</dimen>
     <dimen name="tabs_counter_size">26sp</dimen>
+    <dimen name="addressbar_offset_left">84dip</dimen>
 
 </resources>
--- a/mobile/android/base/resources/values/dimens.xml
+++ b/mobile/android/base/resources/values/dimens.xml
@@ -48,14 +48,15 @@
     <dimen name="tabs_list_divider_height">2dp</dimen>
     <dimen name="text_selection_handle_width">30dp</dimen>
     <dimen name="text_selection_handle_height">44dp</dimen>
     <dimen name="text_selection_handle_shadow">2dp</dimen>
     <dimen name="validation_message_height">50dp</dimen>
     <dimen name="validation_message_margin_top">6dp</dimen>
     <dimen name="widget_padding">8dp</dimen>
 
+    <dimen name="addressbar_offset_left">84dip</dimen>
     <dimen name="app_defaultsize_w">632.0dip</dimen>
     <dimen name="app_defaultsize_h">598.0dip</dimen>
     <dimen name="app_minimumsize_w">632.0dip</dimen>
     <dimen name="app_minimumsize_h">598.0dip</dimen>
    
 </resources>
--- a/mobile/android/base/resources/values/styles.xml
+++ b/mobile/android/base/resources/values/styles.xml
@@ -60,30 +60,43 @@
 
     <!-- Address bar - Button -->
     <style name="AddressBar.Button">
         <item name="android:layout_height">fill_parent</item>
         <item name="android:textSize">16sp</item>
         <item name="android:background">@android:color/transparent</item>
     </style>
 
+    <style name="AddressBar.Button.Container">
+        <item name="android:layout_marginLeft">4dp</item>
+        <item name="android:layout_marginRight">4dp</item>
+        <item name="android:layout_toLeftOf">@id/menu_items</item>
+        <item name="android:layout_alignParentLeft">true</item>
+        <item name="android:layout_alignParentBottom">true</item>
+        <item name="android:layout_centerVertical">true</item>
+    </style>
+
     <!-- Address bar - Image Button -->
     <style name="AddressBar.ImageButton" parent="AddressBar.Button">
         <item name="android:scaleType">center</item>
         <item name="android:layout_gravity">center_vertical</item>
         <item name="android:background">@android:color/transparent</item>
     </style>
 
     <!-- Address bar - Image Button - Unused -->
     <style name="AddressBar.ImageButton.Unused">
         <item name="android:layout_width">0dip</item>
         <item name="android:layout_height">0dip</item>
         <item name="android:visibility">gone</item>
     </style>
 
+    <style name="AddressBar.ImageButton.Forward" parent="AddressBar.ImageButton.Unused">
+        <item name="android:contentDescription">@string/forward</item>
+    </style>
+
     <!-- Address bar - Image Button - Icon -->
     <style name="AddressBar.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>
 
     <!-- AwesomeBar -->