Bug 1084545 - Update nav button stroke colors. r=lucasr

This commit is contained in:
Michael Comella 2014-10-20 08:08:48 -07:00
Родитель ca5ea60b85
Коммит 52796af2ac
4 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -110,6 +110,9 @@
<color name="url_bar_blockedtext">#b14646</color>
<color name="url_bar_shadow">#12000000</color>
<color name="nav_button_border_color">#BFBFBF</color>
<color name="nav_button_border_color_private">#5F6368</color>
<color name="home_button_bar_bg">#FFF5F7F9</color>
<!-- Colour used for share overlay button labels -->

Просмотреть файл

@ -13,13 +13,6 @@ public class BackButton extends NavButton {
super(context, attrs);
}
// TODO: The only reason we can't inherit this method is because there's a color inconsistency.
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
mBorderPaint.setColor(isPrivate ? 0xFF363B40 : 0xFFB5B5B5);
}
@Override
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
super.onSizeChanged(width, height, oldWidth, oldHeight);

Просмотреть файл

@ -12,13 +12,6 @@ public class ForwardButton extends NavButton {
super(context, attrs);
}
// TODO: The only reason we can't inherit this method is because there's a color inconsistency.
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
mBorderPaint.setColor(isPrivate ? 0xFF363B40 : 0xFFBFBFBF);
}
@Override
protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
super.onSizeChanged(width, height, oldWidth, oldHeight);

Просмотреть файл

@ -20,10 +20,15 @@ abstract class NavButton extends ShapedButton {
protected final Paint mBorderPaint;
protected final float mBorderWidth;
protected final int mBorderColor;
protected final int mBorderColorPrivate;
public NavButton(Context context, AttributeSet attrs) {
super(context, attrs);
final Resources res = getResources();
mBorderColor = res.getColor(R.color.nav_button_border_color);
mBorderColorPrivate = res.getColor(R.color.nav_button_border_color_private);
mBorderWidth = res.getDimension(R.dimen.nav_button_border_width);
// Paint to draw the border.
@ -38,6 +43,12 @@ abstract class NavButton extends ShapedButton {
setPrivateMode(false);
}
@Override
public void setPrivateMode(boolean isPrivate) {
super.setPrivateMode(isPrivate);
mBorderPaint.setColor(isPrivate ? mBorderColorPrivate : mBorderColor);
}
@Override
public void draw(Canvas canvas) {
super.draw(canvas);