Bug 1127154 - Use new_tablet_url_bar_nav_button styles on LWT change in NavButton. r=mhaigh, a=sledru
authorMichael Comella <michael.l.comella@gmail.com>
Mon, 02 Feb 2015 10:22:06 -0800
changeset 243635 25a28c2481d2
parent 243634 f308adc4e97c
child 243636 cba5f9bfe66c
push id4421
push userryanvm@gmail.com
push date2015-02-02 19:52 +0000
treeherdermozilla-beta@08a02585bc60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh, sledru
bugs1127154
milestone36.0
Bug 1127154 - Use new_tablet_url_bar_nav_button styles on LWT change in NavButton. r=mhaigh, a=sledru
mobile/android/base/toolbar/NavButton.java
--- a/mobile/android/base/toolbar/NavButton.java
+++ b/mobile/android/base/toolbar/NavButton.java
@@ -53,39 +53,34 @@ abstract class NavButton extends ShapedB
     @Override
     public void draw(Canvas canvas) {
         super.draw(canvas);
 
         // Draw the border on top.
         canvas.drawPath(mBorderPath, mBorderPaint);
     }
 
-    // The drawable is constructed as per @drawable/url_bar_nav_button.
+    // The drawable is constructed as per @drawable/new_tablet_url_bar_nav_button.
     @Override
     public void onLightweightThemeChanged() {
-        final Drawable drawable;
-        if (!NewTabletUI.isEnabled(getContext())) {
-            drawable = mTheme.getDrawable(this);
-        } else {
-            drawable = BrowserToolbar.getLightweightThemeDrawable(this, getResources(), getTheme(),
-                    R.color.background_normal);
-        }
+        final Drawable drawable = BrowserToolbar.getLightweightThemeDrawable(this, getResources(),
+                getTheme(), R.color.background_normal);
 
         if (drawable == null) {
             return;
         }
 
         final StateListDrawable stateList = new StateListDrawable();
-        stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.highlight_nav_pb));
-        stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.highlight_nav));
-        stateList.addState(PRIVATE_FOCUSED_STATE_SET, getColorDrawable(R.color.highlight_nav_focused_pb));
-        stateList.addState(FOCUSED_STATE_SET, getColorDrawable(R.color.highlight_nav_focused));
+        stateList.addState(PRIVATE_PRESSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_pb));
+        stateList.addState(PRESSED_ENABLED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight));
+        stateList.addState(PRIVATE_FOCUSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_focused_pb));
+        stateList.addState(FOCUSED_STATE_SET, getColorDrawable(R.color.new_tablet_highlight_focused));
         stateList.addState(PRIVATE_STATE_SET, getColorDrawable(R.color.background_private));
         stateList.addState(EMPTY_STATE_SET, drawable);
 
         setBackgroundDrawable(stateList);
     }
 
     @Override
     public void onLightweightThemeReset() {
-        setBackgroundResource(R.drawable.url_bar_nav_button);
+        setBackgroundResource(R.drawable.new_tablet_url_bar_nav_button);
     }
 }