Loading mobile/android/app/src/australis/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java 0 → 100644 +25 −0 Original line number Diff line number Diff line /* 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/. */ package org.mozilla.gecko.toolbar; import android.content.Context; import android.util.AttributeSet; import org.mozilla.gecko.widget.themed.ThemedImageButton; class ToolbarRoundButton extends ThemedImageButton { public ToolbarRoundButton(Context context) { this(context, null); } public ToolbarRoundButton(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ToolbarRoundButton(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } } mobile/android/app/src/australis/res/values-large/styles.xml +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ </style> <style name="UrlBar.Button.Container"> <item name="android:layout_marginTop">6dp</item> <item name="android:layout_marginBottom">6dp</item> <!-- Start with forward hidden --> <item name="android:orientation">horizontal</item> </style> Loading mobile/android/app/src/australis/res/values/colors.xml +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,15 @@ <color name="restricted_profile_background_gold">#ffffcb51</color> <color name="restricted_profile_background_green">#1aaa86</color> <!-- Status bar background color --> <color name="status_bar_bg_color">@android:color/transparent</color> <color name="status_bar_bg_color_private">@android:color/transparent</color> <color name="status_bar_bg_color_tablet">@android:color/transparent</color> <!-- Toolbar menu item tint color --> <color name="menu_item_tint">@color/toolbar_icon_grey</color> <color name="menu_item_tint_private">@color/toolbar_icon_grey</color> <!-- Non-palette colors --> <!-- Synced w/ toolbar_grey --> Loading mobile/android/app/src/main/res/values/attrs.xml +5 −0 Original line number Diff line number Diff line Loading @@ -176,5 +176,10 @@ <attr name="drawableTintList" format="color" /> </declare-styleable> <declare-styleable name="NavButton"> <attr name="borderColor" format="color" /> <attr name="borderColorPrivate" format="color" /> </declare-styleable> </resources> mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java 0 → 100644 +55 −0 Original line number Diff line number Diff line /* 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/. */ package org.mozilla.gecko.toolbar; import android.content.Context; import android.content.res.Resources; import android.graphics.Path; import android.graphics.RectF; import android.util.AttributeSet; import org.mozilla.gecko.R; class ToolbarRoundButton extends ShapedButton { public ToolbarRoundButton(Context context) { this(context, null); } public ToolbarRoundButton(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ToolbarRoundButton(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setPrivateMode(false); } @Override protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { super.onSizeChanged(width, height, oldWidth, oldHeight); mPath.reset(); mPath.setFillType(Path.FillType.INVERSE_EVEN_ODD); final Resources res = getResources(); final int vSpace = res.getDimensionPixelSize(R.dimen.browser_toolbar_image_button_v_spacing); final int hSpace = res.getDimensionPixelSize(R.dimen.browser_toolbar_image_button_h_spacing); final RectF rect = new RectF(hSpace, vSpace, width - hSpace, height - vSpace); final int radius = res.getDimensionPixelSize(R.dimen.browser_toolbar_menu_radius); mPath.addRoundRect(rect, radius, radius, Path.Direction.CW); } @Override public void onLightweightThemeChanged() { setBackgroundResource(R.drawable.url_bar_action_button); } @Override public void onLightweightThemeReset() { setBackgroundResource(R.drawable.url_bar_action_button); } } Loading
mobile/android/app/src/australis/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java 0 → 100644 +25 −0 Original line number Diff line number Diff line /* 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/. */ package org.mozilla.gecko.toolbar; import android.content.Context; import android.util.AttributeSet; import org.mozilla.gecko.widget.themed.ThemedImageButton; class ToolbarRoundButton extends ThemedImageButton { public ToolbarRoundButton(Context context) { this(context, null); } public ToolbarRoundButton(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ToolbarRoundButton(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } }
mobile/android/app/src/australis/res/values-large/styles.xml +0 −2 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ </style> <style name="UrlBar.Button.Container"> <item name="android:layout_marginTop">6dp</item> <item name="android:layout_marginBottom">6dp</item> <!-- Start with forward hidden --> <item name="android:orientation">horizontal</item> </style> Loading
mobile/android/app/src/australis/res/values/colors.xml +9 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,15 @@ <color name="restricted_profile_background_gold">#ffffcb51</color> <color name="restricted_profile_background_green">#1aaa86</color> <!-- Status bar background color --> <color name="status_bar_bg_color">@android:color/transparent</color> <color name="status_bar_bg_color_private">@android:color/transparent</color> <color name="status_bar_bg_color_tablet">@android:color/transparent</color> <!-- Toolbar menu item tint color --> <color name="menu_item_tint">@color/toolbar_icon_grey</color> <color name="menu_item_tint_private">@color/toolbar_icon_grey</color> <!-- Non-palette colors --> <!-- Synced w/ toolbar_grey --> Loading
mobile/android/app/src/main/res/values/attrs.xml +5 −0 Original line number Diff line number Diff line Loading @@ -176,5 +176,10 @@ <attr name="drawableTintList" format="color" /> </declare-styleable> <declare-styleable name="NavButton"> <attr name="borderColor" format="color" /> <attr name="borderColorPrivate" format="color" /> </declare-styleable> </resources>
mobile/android/app/src/photon/java/org/mozilla/gecko/toolbar/ToolbarRoundButton.java 0 → 100644 +55 −0 Original line number Diff line number Diff line /* 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/. */ package org.mozilla.gecko.toolbar; import android.content.Context; import android.content.res.Resources; import android.graphics.Path; import android.graphics.RectF; import android.util.AttributeSet; import org.mozilla.gecko.R; class ToolbarRoundButton extends ShapedButton { public ToolbarRoundButton(Context context) { this(context, null); } public ToolbarRoundButton(Context context, AttributeSet attrs) { this(context, attrs, 0); } public ToolbarRoundButton(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setPrivateMode(false); } @Override protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { super.onSizeChanged(width, height, oldWidth, oldHeight); mPath.reset(); mPath.setFillType(Path.FillType.INVERSE_EVEN_ODD); final Resources res = getResources(); final int vSpace = res.getDimensionPixelSize(R.dimen.browser_toolbar_image_button_v_spacing); final int hSpace = res.getDimensionPixelSize(R.dimen.browser_toolbar_image_button_h_spacing); final RectF rect = new RectF(hSpace, vSpace, width - hSpace, height - vSpace); final int radius = res.getDimensionPixelSize(R.dimen.browser_toolbar_menu_radius); mPath.addRoundRect(rect, radius, radius, Path.Direction.CW); } @Override public void onLightweightThemeChanged() { setBackgroundResource(R.drawable.url_bar_action_button); } @Override public void onLightweightThemeReset() { setBackgroundResource(R.drawable.url_bar_action_button); } }