Bug 848707: Change highlight color. [r=mfinkle]
authorSriram Ramasubramanian <sriram@mozilla.com>
Wed, 13 Mar 2013 12:16:09 -0700
changeset 124757 b0a6d63bdec6d310d635ceff409544b2706cfedb
parent 124756 401981c0ea5106f3b2ac986d27c428336eea0624
child 124758 67d0bd22fe140e12e534b22e2c1c1edae4da6b9e
push id1427
push userprouget@mozilla.com
push dateThu, 14 Mar 2013 22:26:18 +0000
treeherderfx-team@a4b1b14b865a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs848707
milestone22.0a1
Bug 848707: Change highlight color. [r=mfinkle]
mobile/android/base/BackButton.java
mobile/android/base/ForwardButton.java
mobile/android/base/Makefile.in
mobile/android/base/MenuButton.java
mobile/android/base/TabsButton.java
mobile/android/base/resources/drawable-large-land-v11/tabs_button.xml
mobile/android/base/resources/drawable/action_bar_button.xml
mobile/android/base/resources/drawable/action_bar_button_inverse.xml
mobile/android/base/resources/drawable/address_bar_nav_button.xml.in
mobile/android/base/resources/drawable/highlight.xml
mobile/android/base/resources/drawable/menu_button.xml
mobile/android/base/resources/drawable/tabs_button.xml
mobile/android/base/resources/drawable/tabs_panel_indicator.xml
mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
mobile/android/base/resources/layout/find_in_page_content.xml
mobile/android/base/resources/layout/remote_tabs_child.xml
mobile/android/base/resources/layout/tabs_item_cell.xml
mobile/android/base/resources/layout/tabs_item_row.xml
mobile/android/base/resources/values/colors.xml
--- a/mobile/android/base/BackButton.java
+++ b/mobile/android/base/BackButton.java
@@ -77,17 +77,17 @@ public class BackButton extends ShapedBu
     public void onLightweightThemeChanged() {
         Drawable drawable = mActivity.getLightweightTheme().getDrawable(this);
         if (drawable == null)
             return;
 
         Resources resources = getContext().getResources();
         StateListDrawable stateList = new StateListDrawable();
 
-        stateList.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
+        stateList.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(resources.getColor(R.color.highlight)));
         stateList.addState(new int[] { R.attr.state_private }, new ColorDrawable(resources.getColor(R.color.background_private)));
         stateList.addState(new int[] {}, drawable);
 
         setBackgroundDrawable(stateList);
     }
 
     @Override
     public void onLightweightThemeReset() {
--- a/mobile/android/base/ForwardButton.java
+++ b/mobile/android/base/ForwardButton.java
@@ -71,17 +71,17 @@ public class ForwardButton extends Shape
     public void onLightweightThemeChanged() {
         Drawable drawable = mActivity.getLightweightTheme().getDrawable(this);
         if (drawable == null)
             return;
 
         Resources resources = getContext().getResources();
         StateListDrawable stateList = new StateListDrawable();
 
-        stateList.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
+        stateList.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(resources.getColor(R.color.highlight)));
         stateList.addState(new int[] { R.attr.state_private }, new ColorDrawable(resources.getColor(R.color.background_private)));
         stateList.addState(new int[] {}, drawable);
 
         setBackgroundDrawable(stateList);
     }
 
     @Override
     public void onLightweightThemeReset() {
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -988,22 +988,22 @@ FENNEC_PP_JAVA_FILES += CrashReporter.ja
 RES_DRAWABLE_MDPI += res/drawable-mdpi/crash_reporter.png
 RES_LAYOUT += res/layout/crash_reporter.xml
 endif
 
 MOZ_ANDROID_DRAWABLES += \
   $(SYNC_RES_DRAWABLE)                                                          \
   mobile/android/base/resources/drawable/abouthome_promo_box.xml                \
   mobile/android/base/resources/drawable/action_bar_button.xml                  \
+  mobile/android/base/resources/drawable/action_bar_button_inverse.xml          \
   mobile/android/base/resources/drawable/address_bar_bg_shadow_repeat.xml       \
   mobile/android/base/resources/drawable/awesomebar_row_favicon_bg.xml          \
   mobile/android/base/resources/drawable/awesomebar_tab_indicator.xml           \
   mobile/android/base/resources/drawable/awesomebar_tab_selected.xml            \
   mobile/android/base/resources/drawable/awesomebar_tab_unselected.xml          \
-  mobile/android/base/resources/drawable/highlight.xml                          \
   mobile/android/base/resources/drawable/handle_end_level.xml                   \
   mobile/android/base/resources/drawable/handle_start_level.xml                 \
   mobile/android/base/resources/drawable/ic_menu_back.xml                       \
   mobile/android/base/resources/drawable/ic_menu_desktop_mode_off.xml           \
   mobile/android/base/resources/drawable/ic_menu_desktop_mode_on.xml            \
   mobile/android/base/resources/drawable/ic_menu_quit.xml                       \
   mobile/android/base/resources/drawable/menu_button.xml                        \
   mobile/android/base/resources/drawable/progress_spinner.xml                   \
--- a/mobile/android/base/MenuButton.java
+++ b/mobile/android/base/MenuButton.java
@@ -58,18 +58,18 @@ public class MenuButton extends ShapedBu
         LightweightThemeDrawable drawable = mActivity.getLightweightTheme().getColorDrawable(this, Color.BLACK);
         if (drawable == null)
             return;
 
         drawable.setAlpha(34, 34);
 
         Resources resources = getContext().getResources();
         StateListDrawable stateList = new StateListDrawable();
+        stateList.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(resources.getColor(R.color.highlight_dark)));
         stateList.addState(new int[] { R.attr.state_private }, new ColorDrawable(Color.BLACK));
-        stateList.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
         stateList.addState(new int[] {}, drawable);
 
         LevelListDrawable levelList = new LevelListDrawable();
         levelList.addLevel(0, 1, stateList);
         levelList.addLevel(2, 2, new ColorDrawable(Color.TRANSPARENT));
 
         setBackgroundDrawable(levelList);
     }
--- a/mobile/android/base/TabsButton.java
+++ b/mobile/android/base/TabsButton.java
@@ -165,22 +165,22 @@ public class TabsButton extends ShapedBu
         if (lightWeight1 == null || lightWeight2 == null)
             return;
 
         lightWeight1.setAlpha(34, 34);
         lightWeight2.setAlpha(34, 34);
 
         Resources resources = this.getContext().getResources();
         StateListDrawable stateList1 = new StateListDrawable();
-        stateList1.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
+        stateList1.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(resources.getColor(R.color.highlight_dark)));
         stateList1.addState(new int[] { R.attr.state_private }, new ColorDrawable(resources.getColor(R.color.background_tabs_light)));
         stateList1.addState(new int[] {}, lightWeight1);
 
         StateListDrawable stateList2 = new StateListDrawable();
-        stateList2.addState(new int[] { android.R.attr.state_pressed }, resources.getDrawable(R.drawable.highlight));
+        stateList2.addState(new int[] { android.R.attr.state_pressed }, new ColorDrawable(resources.getColor(R.color.highlight_dark)));
         stateList2.addState(new int[] { R.attr.state_private }, new ColorDrawable(resources.getColor(R.color.background_tabs_dark)));
         stateList2.addState(new int[] {}, lightWeight2);
 
         LevelListDrawable levelList = new LevelListDrawable();
         levelList.addLevel(0, 1, stateList1);
 
         // If there is a side bar, the expanded state will have a filled button.
         if (mSideBar)
--- a/mobile/android/base/resources/drawable-large-land-v11/tabs_button.xml
+++ b/mobile/android/base/resources/drawable-large-land-v11/tabs_button.xml
@@ -5,30 +5,30 @@
 
 <level-list xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:maxLevel="1">
 
         <selector>
 
             <item android:state_pressed="true"
-                  android:drawable="@drawable/highlight"/>
+                  android:drawable="@color/highlight_dark"/>
 
             <item android:drawable="@color/background_tabs_light"/>
 
         </selector>
 
     </item>
 
     <item android:maxLevel="2">
 
         <selector>
 
             <item android:state_pressed="true"
-                  android:drawable="@drawable/highlight"/>
+                  android:drawable="@color/highlight_dark"/>
 
             <item android:drawable="@color/background_tabs_dark"/>
 
         </selector>
 
     </item>
 
 </level-list>
--- a/mobile/android/base/resources/drawable/action_bar_button.xml
+++ b/mobile/android/base/resources/drawable/action_bar_button.xml
@@ -1,11 +1,11 @@
 <?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/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android">
 
-    <item android:state_pressed="true" android:drawable="@drawable/highlight"/>
+    <item android:state_pressed="true" android:drawable="@color/highlight"/>
     <item android:drawable="@android:color/transparent"/>
 
 </selector>
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/resources/drawable/action_bar_button_inverse.xml
@@ -0,0 +1,11 @@
+<?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/. -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_pressed="true" android:drawable="@color/highlight_dark"/>
+    <item android:drawable="@android:color/transparent"/>
+
+</selector>
--- a/mobile/android/base/resources/drawable/address_bar_nav_button.xml.in
+++ b/mobile/android/base/resources/drawable/address_bar_nav_button.xml.in
@@ -3,17 +3,17 @@
 <!-- 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/. -->
 
 <selector xmlns:android="http://schemas.android.com/apk/res/android"
           xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@">
 
     <!-- pressed state -->
-    <item android:state_pressed="true" android:drawable="@drawable/highlight"/>
+    <item android:state_pressed="true" android:drawable="@color/highlight"/>
 
     <!-- private browsing mode -->
     <item gecko:state_private="true" android:drawable="@color/background_private"/>
 
     <!-- normal mode -->
     <item android:drawable="@color/background_normal"/>
 
 </selector>
deleted file mode 100644
--- a/mobile/android/base/resources/drawable/highlight.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?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/. -->
-
-<shape xmlns:android="http://schemas.android.com/apk/res/android"
-       android:shape="rectangle">
-
-       <gradient android:angle="90"
-                 android:startColor="#E66000"
-                 android:endColor="#FF9500"
-                 android:type="linear"/>
-
-</shape>
--- a/mobile/android/base/resources/drawable/menu_button.xml
+++ b/mobile/android/base/resources/drawable/menu_button.xml
@@ -2,16 +2,16 @@
 <!-- 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/. -->
 
 <level-list xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:maxLevel="1">
         <selector>
-            <item android:state_pressed="true" android:drawable="@drawable/highlight"/>
+            <item android:state_pressed="true" android:drawable="@color/highlight_dark"/>
             <item android:drawable="@android:color/black"/>
         </selector>
     </item>
 
     <item android:maxLevel="2" android:drawable="@android:color/transparent"/>
 
 </level-list>
--- a/mobile/android/base/resources/drawable/tabs_button.xml
+++ b/mobile/android/base/resources/drawable/tabs_button.xml
@@ -5,17 +5,17 @@
 
 <level-list xmlns:android="http://schemas.android.com/apk/res/android">
 
     <item android:maxLevel="1">
 
         <selector>
 
             <item android:state_pressed="true"
-                  android:drawable="@drawable/highlight"/>
+                  android:drawable="@color/highlight_dark"/>
 
             <item android:drawable="@color/background_tabs_light"/>
 
         </selector>
 
     </item>
 
     <item android:maxLevel="2" android:drawable="@android:color/transparent"/>
--- a/mobile/android/base/resources/drawable/tabs_panel_indicator.xml
+++ b/mobile/android/base/resources/drawable/tabs_panel_indicator.xml
@@ -23,26 +23,26 @@
     <item android:state_focused="true"
           android:state_selected="true"
           android:state_pressed="false"
           android:drawable="@drawable/tab_indicator_selected_focused"/>
 
     <item android:state_focused="false"
           android:state_selected="false"
           android:state_pressed="true"
-          android:drawable="@drawable/highlight"/>
+          android:drawable="@color/highlight_dark"/>
 
     <item android:state_focused="false"
           android:state_selected="true"
           android:state_pressed="true"
-          android:drawable="@drawable/highlight"/>
+          android:drawable="@color/highlight_dark"/>
 
     <item android:state_focused="true"
           android:state_selected="false"
           android:state_pressed="true"
-          android:drawable="@drawable/highlight"/>
+          android:drawable="@color/highlight_dark"/>
 
     <item android:state_focused="true"
           android:state_selected="true"
           android:state_pressed="true"
-          android:drawable="@drawable/highlight"/>
+          android:drawable="@color/highlight_dark"/>
 
 </selector>
--- a/mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
+++ b/mobile/android/base/resources/layout-large-land-v11/tabs_panel_footer.xml
@@ -6,12 +6,12 @@
 <merge xmlns:android="http://schemas.android.com/apk/res/android">
 
     <ImageButton android:id="@+id/add_tab"
                  android:layout_width="fill_parent"
                  android:layout_height="@dimen/browser_toolbar_height"
                  android:padding="14dip"
                  android:src="@drawable/tab_new_level"
                  android:contentDescription="@string/new_tab"
-                 android:background="@drawable/action_bar_button"
+                 android:background="@drawable/action_bar_button_inverse"
                  android:gravity="center"/>
 
 </merge>
--- a/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
+++ b/mobile/android/base/resources/layout-xlarge-v11/remote_tabs_child.xml
@@ -3,17 +3,17 @@
    - 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/. -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="fill_parent"
               android:layout_height="@dimen/remote_tab_child_row_height"
               android:gravity="center_vertical"
               android:orientation="vertical"
-              android:background="@drawable/action_bar_button"
+              android:background="@drawable/action_bar_button_inverse"
               android:paddingLeft="2dp"
               android:paddingRight="2dp">
 
     <TextView android:id="@+id/tab"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               style="@style/TabRowTextAppearance"
               android:textSize="14sp"/>
--- a/mobile/android/base/resources/layout/find_in_page_content.xml
+++ b/mobile/android/base/resources/layout/find_in_page_content.xml
@@ -21,25 +21,25 @@
               android:gravity="center_vertical|left"
               android:layout_toLeftOf="@+id/find_prev"/>
 
     <ImageButton android:id="@+id/find_prev"
                  style="@style/FindBar.ImageButton"
                  android:contentDescription="@string/find_prev"
                  android:src="@drawable/find_prev"
                  android:layout_toLeftOf="@+id/find_next"
-                 android:background="@drawable/action_bar_button"/>
+                 android:background="@drawable/action_bar_button_inverse"/>
 
     <ImageButton android:id="@+id/find_next"
                  style="@style/FindBar.ImageButton"
                  android:contentDescription="@string/find_next"
                  android:src="@drawable/find_next"
                  android:layout_toLeftOf="@+id/find_close"
-                 android:background="@drawable/action_bar_button"/>
+                 android:background="@drawable/action_bar_button_inverse"/>
 
     <ImageButton android:id="@+id/find_close"
                  style="@style/FindBar.ImageButton"
                  android:contentDescription="@string/find_close"
                  android:src="@drawable/find_close"
                  android:layout_alignParentRight="true"
-                 android:background="@drawable/action_bar_button"/>
+                 android:background="@drawable/action_bar_button_inverse"/>
 
 </merge>
--- a/mobile/android/base/resources/layout/remote_tabs_child.xml
+++ b/mobile/android/base/resources/layout/remote_tabs_child.xml
@@ -3,17 +3,17 @@
    - 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/. -->
 
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
               android:layout_width="fill_parent"
               android:layout_height="@dimen/remote_tab_child_row_height"
               android:gravity="center_vertical"
               android:orientation="vertical"
-              android:background="@drawable/action_bar_button"
+              android:background="@drawable/action_bar_button_inverse"
               android:paddingLeft="4dp"
               android:paddingRight="4dp">
 
     <TextView android:id="@+id/tab"
               android:layout_width="fill_parent"
               android:layout_height="wrap_content"
               style="@style/TabRowTextAppearance"
               android:textSize="18sp"/>
--- a/mobile/android/base/resources/layout/tabs_item_cell.xml
+++ b/mobile/android/base/resources/layout/tabs_item_cell.xml
@@ -43,17 +43,17 @@
                       android:textColor="#FF222222"
                       android:singleLine="true"
                       android:duplicateParentState="true"/>
 
             <ImageButton android:id="@+id/close"
                          android:nextFocusLeft="@+id/info"
                          android:layout_width="32dip"
                          android:layout_height="fill_parent"
-                         android:background="@drawable/action_bar_button"
+                         android:background="@drawable/action_bar_button_inverse"
                          android:scaleType="center"
                          android:contentDescription="@string/close_tab"
                          android:src="@drawable/tab_close"/>
 
         </LinearLayout>
 
     </RelativeLayout>
 
--- a/mobile/android/base/resources/layout/tabs_item_row.xml
+++ b/mobile/android/base/resources/layout/tabs_item_row.xml
@@ -40,14 +40,14 @@
               android:singleLine="false"
               android:maxLines="4"
               android:duplicateParentState="true"/>
 
     <ImageButton android:id="@+id/close"
                  android:nextFocusLeft="@+id/info"
                  android:layout_width="34dip"
                  android:layout_height="fill_parent"
-                 android:background="@drawable/action_bar_button"
+                 android:background="@drawable/action_bar_button_inverse"
                  android:scaleType="center"
                  android:contentDescription="@string/close_tab"
                  android:src="@drawable/tab_close"/>
 
 </Gecko.TabRow>
--- a/mobile/android/base/resources/values/colors.xml
+++ b/mobile/android/base/resources/values/colors.xml
@@ -3,16 +3,18 @@
    - 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>
   <color name="background_normal">#FFCED7DE</color>
   <color name="background_private">#FF292C29</color>
   <color name="background_tabs_dark">#FF363B40</color>
   <color name="background_tabs_light">#FF43484E</color>
+  <color name="highlight">#33000000</color>
+  <color name="highlight_dark">#33FFFFFF</color>
   <color name="autocomplete_listitem_text">#000000</color>
   <color name="splash_background">#000000</color>
   <color name="splash_msgfont">#ffffff</color>
   <color name="splash_urlfont">#000000</color>
   <color name="splash_content">#ffffff</color>
   <color name="doorhanger_text">#FF222222</color>
   <color name="doorhanger_link">#ACC4D5</color>
   <color name="validation_message_text">#ffffff</color>