Bug 806937: Private browsing mode support for Menu button. [r=mfinkle]
--HG-- rename : mobile/android/base/resources/drawable/menu_level.xml => mobile/android/base/resources/drawable/menu_level.xml.in
@ -70,7 +70,7 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
|
||||
private AnimationDrawable mProgressSpinner;
|
||||
private GeckoTextSwitcher mTabsCount;
|
||||
private ImageView mShadow;
|
||||
private ImageButton mMenu;
|
||||
private GeckoImageButton mMenu;
|
||||
private LinearLayout mActionItemBar;
|
||||
private MenuPopup mMenuPopup;
|
||||
private List<View> mFocusOrder;
|
||||
@ -291,7 +291,7 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
|
||||
mTitleSlideLeft.setDuration(lockAnimDuration);
|
||||
mTitleSlideRight.setDuration(lockAnimDuration);
|
||||
|
||||
mMenu = (ImageButton) mLayout.findViewById(R.id.menu);
|
||||
mMenu = (GeckoImageButton) mLayout.findViewById(R.id.menu);
|
||||
mActionItemBar = (LinearLayout) mLayout.findViewById(R.id.menu_items);
|
||||
mHasSoftMenuButton = !mActivity.hasPermanentMenuKey();
|
||||
|
||||
@ -799,6 +799,7 @@ public class BrowserToolbar implements ViewSwitcher.ViewFactory,
|
||||
mTabsCount.setPrivateMode(tab.isPrivate());
|
||||
((GeckoTextView) mTabsCount.getCurrentView()).setPrivateMode(tab.isPrivate());
|
||||
mTitle.setPrivateMode(tab.isPrivate());
|
||||
mMenu.setPrivateMode(tab.isPrivate());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -226,6 +226,7 @@ FENNEC_PP_XML_FILES = \
|
||||
res/color/tabs_counter_color.xml \
|
||||
res/drawable/address_bar_bg.xml \
|
||||
res/drawable/address_bar_url.xml \
|
||||
res/drawable/menu_level.xml \
|
||||
res/drawable/tabs_button.xml \
|
||||
res/drawable/tabs_level.xml \
|
||||
res/drawable-xlarge-mdpi-v11/tabs_button.xml \
|
||||
@ -735,6 +736,7 @@ RES_DRAWABLE_MDPI_V11 = \
|
||||
res/drawable-mdpi-v11/ic_menu_quit.png \
|
||||
res/drawable-mdpi-v11/ic_status_logo.png \
|
||||
res/drawable-mdpi-v11/menu.png \
|
||||
res/drawable-mdpi-v11/menu_pb.png \
|
||||
res/drawable-mdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-mdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-mdpi-v11/menu_popup_arrow.png \
|
||||
@ -769,6 +771,7 @@ RES_DRAWABLE_HDPI_V11 = \
|
||||
res/drawable-hdpi-v11/ic_menu_quit.png \
|
||||
res/drawable-hdpi-v11/ic_status_logo.png \
|
||||
res/drawable-hdpi-v11/menu.png \
|
||||
res/drawable-hdpi-v11/menu_pb.png \
|
||||
res/drawable-hdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-hdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-hdpi-v11/menu_popup_arrow.png \
|
||||
@ -803,6 +806,7 @@ RES_DRAWABLE_XHDPI_V11 = \
|
||||
res/drawable-xhdpi-v11/ic_menu_quit.png \
|
||||
res/drawable-xhdpi-v11/ic_status_logo.png \
|
||||
res/drawable-xhdpi-v11/menu.png \
|
||||
res/drawable-xhdpi-v11/menu_pb.png \
|
||||
res/drawable-xhdpi-v11/menu_panel_bg.9.png \
|
||||
res/drawable-xhdpi-v11/menu_popup_bg.9.png \
|
||||
res/drawable-xhdpi-v11/menu_popup_arrow.png \
|
||||
@ -832,6 +836,7 @@ RES_DRAWABLE_LAND_MDPI_V14 = \
|
||||
res/drawable-land-mdpi-v14/tabs_carat_pb.png \
|
||||
res/drawable-land-mdpi-v14/urlbar_stop.png \
|
||||
res/drawable-land-mdpi-v14/menu.png \
|
||||
res/drawable-land-mdpi-v14/menu_pb.png \
|
||||
res/drawable-land-mdpi-v14/reader.png \
|
||||
res/drawable-land-mdpi-v14/site_security_identified.png \
|
||||
res/drawable-land-mdpi-v14/site_security_verified.png \
|
||||
@ -853,6 +858,7 @@ RES_DRAWABLE_LAND_HDPI_V14 = \
|
||||
res/drawable-land-hdpi-v14/tabs_carat_pb.png \
|
||||
res/drawable-land-hdpi-v14/urlbar_stop.png \
|
||||
res/drawable-land-hdpi-v14/menu.png \
|
||||
res/drawable-land-hdpi-v14/menu_pb.png \
|
||||
res/drawable-land-hdpi-v14/reader.png \
|
||||
res/drawable-land-hdpi-v14/site_security_identified.png \
|
||||
res/drawable-land-hdpi-v14/site_security_verified.png \
|
||||
@ -874,6 +880,7 @@ RES_DRAWABLE_LAND_XHDPI_V14 = \
|
||||
res/drawable-land-xhdpi-v14/tabs_carat_pb.png \
|
||||
res/drawable-land-xhdpi-v14/urlbar_stop.png \
|
||||
res/drawable-land-xhdpi-v14/menu.png \
|
||||
res/drawable-land-xhdpi-v14/menu_pb.png \
|
||||
res/drawable-land-xhdpi-v14/reader.png \
|
||||
res/drawable-land-xhdpi-v14/site_security_identified.png \
|
||||
res/drawable-land-xhdpi-v14/site_security_verified.png \
|
||||
@ -904,6 +911,7 @@ RES_DRAWABLE_LARGE_MDPI_V11 = \
|
||||
res/drawable-large-mdpi-v11/site_security_identified.png \
|
||||
res/drawable-large-mdpi-v11/site_security_verified.png \
|
||||
res/drawable-large-mdpi-v11/menu.png \
|
||||
res/drawable-large-mdpi-v11/menu_pb.png \
|
||||
res/drawable-large-mdpi-v11/tabs_carat.png \
|
||||
res/drawable-large-mdpi-v11/tabs_carat_pb.png \
|
||||
$(NULL)
|
||||
@ -931,6 +939,7 @@ RES_DRAWABLE_LARGE_HDPI_V11 = \
|
||||
res/drawable-large-hdpi-v11/site_security_identified.png \
|
||||
res/drawable-large-hdpi-v11/site_security_verified.png \
|
||||
res/drawable-large-hdpi-v11/menu.png \
|
||||
res/drawable-large-hdpi-v11/menu_pb.png \
|
||||
res/drawable-large-hdpi-v11/tabs_carat.png \
|
||||
res/drawable-large-hdpi-v11/tabs_carat_pb.png \
|
||||
$(NULL)
|
||||
@ -958,6 +967,7 @@ RES_DRAWABLE_LARGE_XHDPI_V11 = \
|
||||
res/drawable-large-xhdpi-v11/site_security_identified.png \
|
||||
res/drawable-large-xhdpi-v11/site_security_verified.png \
|
||||
res/drawable-large-xhdpi-v11/menu.png \
|
||||
res/drawable-large-xhdpi-v11/menu_pb.png \
|
||||
res/drawable-large-xhdpi-v11/tabs_carat.png \
|
||||
res/drawable-large-xhdpi-v11/tabs_carat_pb.png \
|
||||
$(NULL)
|
||||
@ -967,6 +977,7 @@ RES_DRAWABLE_XLARGE_MDPI_V11 = \
|
||||
res/drawable-xlarge-mdpi-v11/awesomebar_tab_left.9.png \
|
||||
res/drawable-xlarge-mdpi-v11/awesomebar_tab_right.9.png \
|
||||
res/drawable-xlarge-mdpi-v11/menu.png \
|
||||
res/drawable-xlarge-mdpi-v11/menu_pb.png \
|
||||
res/drawable-xlarge-mdpi-v11/tabs_carat_contracted.png \
|
||||
res/drawable-xlarge-mdpi-v11/tabs_carat_contracted_pb.png \
|
||||
res/drawable-xlarge-mdpi-v11/tabs_carat_expanded.png \
|
||||
@ -978,6 +989,7 @@ RES_DRAWABLE_XLARGE_HDPI_V11 = \
|
||||
res/drawable-xlarge-hdpi-v11/awesomebar_tab_left.9.png \
|
||||
res/drawable-xlarge-hdpi-v11/awesomebar_tab_right.9.png \
|
||||
res/drawable-xlarge-hdpi-v11/menu.png \
|
||||
res/drawable-xlarge-hdpi-v11/menu_pb.png \
|
||||
res/drawable-xlarge-hdpi-v11/tabs_carat_contracted.png \
|
||||
res/drawable-xlarge-hdpi-v11/tabs_carat_contracted_pb.png \
|
||||
res/drawable-xlarge-hdpi-v11/tabs_carat_expanded.png \
|
||||
@ -989,6 +1001,7 @@ RES_DRAWABLE_XLARGE_XHDPI_V11 = \
|
||||
res/drawable-xlarge-xhdpi-v11/awesomebar_tab_left.9.png \
|
||||
res/drawable-xlarge-xhdpi-v11/awesomebar_tab_right.9.png \
|
||||
res/drawable-xlarge-xhdpi-v11/menu.png \
|
||||
res/drawable-xlarge-xhdpi-v11/menu_pb.png \
|
||||
res/drawable-xlarge-xhdpi-v11/tabs_carat_contracted.png \
|
||||
res/drawable-xlarge-xhdpi-v11/tabs_carat_contracted_pb.png \
|
||||
res/drawable-xlarge-xhdpi-v11/tabs_carat_expanded.png \
|
||||
@ -1033,7 +1046,6 @@ MOZ_ANDROID_DRAWABLES += \
|
||||
mobile/android/base/resources/drawable/handle_start_level.xml \
|
||||
mobile/android/base/resources/drawable/menu_button.xml \
|
||||
mobile/android/base/resources/drawable/menu_item_checkmark.xml \
|
||||
mobile/android/base/resources/drawable/menu_level.xml \
|
||||
mobile/android/base/resources/drawable/progress_spinner.xml \
|
||||
mobile/android/base/resources/drawable/progress_spinner_1.png \
|
||||
mobile/android/base/resources/drawable/progress_spinner_2.png \
|
||||
|
@ -66,6 +66,7 @@ public class MenuButton extends ShapedButton {
|
||||
LayerDrawable layers = new LayerDrawable(new Drawable[] { new ColorDrawable(Color.BLACK), drawable });
|
||||
|
||||
StateListDrawable stateList = new StateListDrawable();
|
||||
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[] {}, layers);
|
||||
|
||||
|
BIN
mobile/android/base/resources/drawable-hdpi-v11/menu_pb.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/android/base/resources/drawable-land-hdpi-v14/menu_pb.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
mobile/android/base/resources/drawable-land-mdpi-v14/menu_pb.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
BIN
mobile/android/base/resources/drawable-mdpi-v11/menu_pb.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
mobile/android/base/resources/drawable-xhdpi-v11/menu_pb.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.8 KiB |
@ -1,11 +1,22 @@
|
||||
#filter substitution
|
||||
<?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/. -->
|
||||
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<level-list xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:gecko="http://schemas.android.com/apk/res/@ANDROID_PACKAGE_NAME@">
|
||||
|
||||
<item android:maxLevel="1" android:drawable="@drawable/menu"/>
|
||||
<item android:maxLevel="1">
|
||||
|
||||
<selector>
|
||||
|
||||
<item gecko:state_private="true" android:drawable="@drawable/menu_pb"/>
|
||||
<item android:drawable="@drawable/menu"/>
|
||||
|
||||
</selector>
|
||||
|
||||
</item>
|
||||
|
||||
<item android:maxLevel="2" android:drawable="@android:color/transparent"/>
|
||||
|
@ -39,17 +39,17 @@
|
||||
android:layout_alignLeft="@id/tabs"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<ImageButton android:id="@+id/menu"
|
||||
style="@style/AddressBar.ImageButton"
|
||||
android:layout_width="56dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/menu"
|
||||
android:contentDescription="@string/menu"
|
||||
android:background="@drawable/action_bar_button"
|
||||
android:paddingLeft="14dip"
|
||||
android:paddingRight="14dip"
|
||||
android:visibility="gone"/>
|
||||
<Gecko.ImageButton android:id="@+id/menu"
|
||||
style="@style/AddressBar.ImageButton"
|
||||
android:layout_width="56dip"
|
||||
android:layout_alignParentRight="true"
|
||||
android:gravity="center_vertical"
|
||||
android:src="@drawable/menu_level"
|
||||
android:contentDescription="@string/menu"
|
||||
android:background="@drawable/action_bar_button"
|
||||
android:paddingLeft="14dip"
|
||||
android:paddingRight="14dip"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout android:id="@+id/menu_items"
|
||||
android:layout_width="wrap_content"
|
||||
|