зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1077755 - Change pressed/focused private browsing colors of new tablet menu items. r=lucasr
This commit is contained in:
Родитель
a8c06aba32
Коммит
6806c1f942
|
@ -6,13 +6,14 @@ package org.mozilla.gecko.menu;
|
|||
|
||||
import org.mozilla.gecko.NewTabletUI;
|
||||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.widget.ThemedImageButton;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
public class MenuItemActionBar extends ImageButton
|
||||
public class MenuItemActionBar extends ThemedImageButton
|
||||
implements GeckoMenuItem.Layout {
|
||||
private static final String LOGTAG = "GeckoMenuItemActionBar";
|
||||
|
||||
|
|
|
@ -3,7 +3,40 @@
|
|||
- 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">
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item gecko:state_private="true"
|
||||
android:state_pressed="true"
|
||||
android:state_enabled="true">
|
||||
|
||||
<inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
|
||||
android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
|
||||
android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
|
||||
android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/new_tablet_highlight_pb"/>
|
||||
<corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
|
||||
</shape>
|
||||
</inset>
|
||||
|
||||
</item>
|
||||
|
||||
<item gecko:state_private="true"
|
||||
android:state_focused="true"
|
||||
android:state_pressed="false">
|
||||
|
||||
<inset android:insetTop="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
|
||||
android:insetBottom="@dimen/new_tablet_browser_toolbar_menu_item_inset_vertical"
|
||||
android:insetLeft="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal"
|
||||
android:insetRight="@dimen/new_tablet_browser_toolbar_menu_item_inset_horizontal">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/new_tablet_highlight_focused_pb"/>
|
||||
<corners android:radius="@dimen/new_tablet_browser_toolbar_menu_item_corner_radius"/>
|
||||
</shape>
|
||||
</inset>
|
||||
|
||||
</item>
|
||||
|
||||
<item android:state_pressed="true"
|
||||
android:state_enabled="true">
|
||||
|
|
|
@ -10,6 +10,7 @@ import java.util.Arrays;
|
|||
import org.mozilla.gecko.R;
|
||||
import org.mozilla.gecko.Tab;
|
||||
import org.mozilla.gecko.Tabs;
|
||||
import org.mozilla.gecko.menu.MenuItemActionBar;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
@ -121,8 +122,13 @@ abstract class BrowserToolbarTabletBase extends BrowserToolbar {
|
|||
@Override
|
||||
public void setPrivateMode(final boolean isPrivate) {
|
||||
super.setPrivateMode(isPrivate);
|
||||
|
||||
backButton.setPrivateMode(isPrivate);
|
||||
forwardButton.setPrivateMode(isPrivate);
|
||||
for (int i = 0; i < actionItemBar.getChildCount(); ++i) {
|
||||
final MenuItemActionBar child = (MenuItemActionBar) actionItemBar.getChildAt(i);
|
||||
child.setPrivateMode(isPrivate);
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean canDoBack(final Tab tab) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX EditText
|
||||
#define BASE_TYPE android.widget.EditText
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX ImageButton
|
||||
#define BASE_TYPE android.widget.ImageButton
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX ImageView
|
||||
#define BASE_TYPE android.widget.ImageView
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX RelativeLayout
|
||||
#define BASE_TYPE android.widget.RelativeLayout
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX TextView
|
||||
#define BASE_TYPE android.widget.TextView
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
|
@ -31,7 +31,16 @@ public class Themed@VIEW_NAME_SUFFIX@ extends @BASE_TYPE@
|
|||
private boolean mAutoUpdateTheme = true;
|
||||
|
||||
public Themed@VIEW_NAME_SUFFIX@(Context context, AttributeSet attrs) {
|
||||
this(context, attrs, 0);
|
||||
}
|
||||
|
||||
public Themed@VIEW_NAME_SUFFIX@(Context context, AttributeSet attrs, int defStyle) {
|
||||
#ifdef STYLE_CONSTRUCTOR
|
||||
super(context, attrs, defStyle);
|
||||
#else
|
||||
super(context, attrs);
|
||||
#endif
|
||||
|
||||
mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
|
||||
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#filter substitution
|
||||
#define VIEW_NAME_SUFFIX View
|
||||
#define BASE_TYPE android.view.View
|
||||
#define STYLE_CONSTRUCTOR 1
|
||||
#include ThemedView.java.frag
|
||||
|
|
Загрузка…
Ссылка в новой задаче