Bug 1148550 - Update 3-dot menu icon to Material on toolbar. r=mhaigh
authorMichael Comella <michael.l.comella@gmail.com>
Fri, 21 Aug 2015 17:34:00 -0700
changeset 260405 66f081a2d7d9ab9b88e0d98373e6660e853dc810
parent 260404 0cc28c71117e2393dad210fc5689e1e9c203d327
child 260406 f4080d4944724f46b296ef0fd4219859796d3b56
push id64495
push userryanvm@gmail.com
push dateWed, 02 Sep 2015 01:16:33 +0000
treeherdermozilla-inbound@e747377d86eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmhaigh
bugs1148550
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1148550 - Update 3-dot menu icon to Material on toolbar. r=mhaigh Other 3-dot menu button locations to follow. I tested that the colors are correct in the various states (e.g. private browsing). This patch additionally: * Restructured the menu button (which allowed the removal of a setVisibility call * Removed the now unused tablet assets.
mobile/android/base/resources/drawable-large-hdpi-v11/tablet_menu.png
mobile/android/base/resources/drawable-large-xhdpi-v11/tablet_menu.png
mobile/android/base/resources/drawable-large-xxhdpi-v11/tablet_menu.png
mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
mobile/android/base/resources/layout/browser_toolbar.xml
mobile/android/base/resources/menu-v11/preferences_search_menu.xml
mobile/android/base/toolbar/BrowserToolbar.java
deleted file mode 100644
index bb7d8e2dbe8ea0560e7e2f430e75c9909e399f1f..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 7598da1a70ce458655bdf31ffe06c3e56dbebb71..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 94fa25f9fa0125582a2eae6a6710b5183d5bb923..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
--- a/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout-large-v11/browser_toolbar.xml
@@ -104,32 +104,35 @@
                         android:layout_alignRight="@id/tabs"
                         android:layout_alignTop="@id/tabs"
                         android:layout_alignBottom="@id/tabs"
                         android:layout_marginTop="18dp"
                         android:layout_marginBottom="18dp"
                         android:layout_marginLeft="16dp"
                         android:layout_marginRight="16dp"/>
 
-    <org.mozilla.gecko.widget.themed.ThemedImageButton
+    <org.mozilla.gecko.widget.themed.ThemedFrameLayout
             android:id="@+id/menu"
             style="@style/UrlBar.ImageButton"
             android:layout_alignParentRight="true"
             android:layout_marginRight="6dp"
             android:contentDescription="@string/menu"
             android:background="@drawable/browser_toolbar_action_bar_button"
-            android:visibility="gone"/>
+            android:visibility="gone">
 
-    <org.mozilla.gecko.widget.themed.ThemedImageView
-            android:id="@+id/menu_icon"
-            style="@style/UrlBar.ImageButton.BrowserToolbarColors"
-            android:layout_alignLeft="@id/menu"
-            android:layout_alignRight="@id/menu"
-            android:src="@drawable/tablet_menu"
-            android:visibility="gone"/>
+        <org.mozilla.gecko.widget.themed.ThemedImageView
+                android:id="@+id/menu_icon"
+                style="@style/UrlBar.ImageButton.BrowserToolbarColors"
+                android:layout_height="18dp"
+                android:layout_width="wrap_content"
+                android:scaleType="centerInside"
+                android:src="@drawable/menu"
+                android:layout_gravity="center"/>
+
+    </org.mozilla.gecko.widget.themed.ThemedFrameLayout>
 
     <!-- We draw after the menu items so when they are hidden, the cancel button,
          which is thus drawn on top, may be pressed. -->
     <org.mozilla.gecko.widget.themed.ThemedImageView
             android:id="@+id/edit_cancel"
             style="@style/UrlBar.ImageButton.Icon"
             android:layout_alignParentRight="true"
             android:src="@drawable/close_edit_mode_selector"
--- a/mobile/android/base/resources/layout/browser_toolbar.xml
+++ b/mobile/android/base/resources/layout/browser_toolbar.xml
@@ -31,30 +31,35 @@
                android:layout_alignBottom="@id/url_bar_entry"
                android:duplicateParentState="true"
                android:clickable="false"
                android:focusable="false"
                android:visibility="invisible"
                android:src="@drawable/url_bar_translating_edge"
                android:scaleType="fitXY"/>
 
-    <org.mozilla.gecko.toolbar.ShapedButton android:id="@+id/menu"
-                                            style="@style/UrlBar.ImageButton"
-                                            android:layout_alignParentRight="true"
-                                            android:contentDescription="@string/menu"
-                                            android:background="@drawable/shaped_button"
-                                            android:visibility="gone"/>
+    <org.mozilla.gecko.widget.themed.ThemedFrameLayout
+            android:id="@+id/menu"
+            style="@style/UrlBar.ImageButton"
+            android:layout_alignParentRight="true"
+            android:contentDescription="@string/menu"
+            android:background="@drawable/shaped_button"
+            android:visibility="gone">
 
-    <org.mozilla.gecko.widget.themed.ThemedImageView android:id="@+id/menu_icon"
-                                              style="@style/UrlBar.ImageButton"
-                                              android:layout_alignLeft="@id/menu"
-                                              android:layout_alignRight="@id/menu"
-                                              android:gravity="center_vertical"
-                                              android:src="@drawable/menu"
-                                              android:visibility="gone"/>
+        <org.mozilla.gecko.widget.themed.ThemedImageView
+                android:id="@+id/menu_icon"
+                style="@style/UrlBar.ImageButton"
+                android:layout_height="16dp"
+                android:layout_width="wrap_content"
+                android:scaleType="centerInside"
+                android:layout_gravity="center"
+                android:src="@drawable/menu"
+                android:tint="@color/tabs_tray_icon_grey"/>
+
+    </org.mozilla.gecko.widget.themed.ThemedFrameLayout>
 
     <org.mozilla.gecko.toolbar.PhoneTabsButton android:id="@+id/tabs"
                                                style="@style/UrlBar.ImageButton"
                                                android:layout_width="64dip"
                                                android:layout_toLeftOf="@id/menu"
                                                android:layout_alignWithParentIfMissing="true"
                                                android:background="@drawable/shaped_button"/>
 
--- a/mobile/android/base/resources/menu-v11/preferences_search_menu.xml
+++ b/mobile/android/base/resources/menu-v11/preferences_search_menu.xml
@@ -1,11 +1,11 @@
 <?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/. -->
 
 <menu xmlns:android="http://schemas.android.com/apk/res/android">
 	<item android:id="@+id/restore_defaults"
-	      android:drawable="@drawable/tablet_menu"
+	      android:drawable="@drawable/menu"
 	      android:showAsAction="never"
 	      android:title="@string/pref_search_restore_defaults" />
 </menu>
--- a/mobile/android/base/toolbar/BrowserToolbar.java
+++ b/mobile/android/base/toolbar/BrowserToolbar.java
@@ -27,16 +27,17 @@ import org.mozilla.gecko.menu.MenuPopup;
 import org.mozilla.gecko.tabs.TabHistoryController;
 import org.mozilla.gecko.toolbar.ToolbarDisplayLayout.OnStopListener;
 import org.mozilla.gecko.toolbar.ToolbarDisplayLayout.OnTitleChangeListener;
 import org.mozilla.gecko.toolbar.ToolbarDisplayLayout.UpdateFlags;
 import org.mozilla.gecko.util.Clipboard;
 import org.mozilla.gecko.util.ColorUtils;
 import org.mozilla.gecko.util.HardwareUtils;
 import org.mozilla.gecko.util.MenuUtils;
+import org.mozilla.gecko.widget.themed.ThemedFrameLayout;
 import org.mozilla.gecko.widget.themed.ThemedImageButton;
 import org.mozilla.gecko.widget.themed.ThemedImageView;
 import org.mozilla.gecko.widget.themed.ThemedRelativeLayout;
 
 import android.content.Context;
 import android.content.res.Resources;
 import android.graphics.Canvas;
 import android.graphics.Paint;
@@ -112,17 +113,17 @@ public abstract class BrowserToolbar ext
     protected final ToolbarDisplayLayout urlDisplayLayout;
     protected final ToolbarEditLayout urlEditLayout;
     protected final View urlBarEntry;
     protected boolean isSwitchingTabs;
     protected final ThemedImageButton tabsButton;
 
     private ToolbarProgressView progressBar;
     protected final TabCounter tabsCounter;
-    protected final ThemedImageButton menuButton;
+    protected final ThemedFrameLayout menuButton;
     protected final ThemedImageView menuIcon;
     private MenuPopup menuPopup;
     protected final List<View> focusOrder;
 
     private OnActivateListener activateListener;
     private OnFocusChangeListener focusChangeListener;
     private OnStartEditingListener startEditingListener;
     private OnStopEditingListener stopEditingListener;
@@ -187,17 +188,17 @@ public abstract class BrowserToolbar ext
         urlEditLayout = (ToolbarEditLayout) findViewById(R.id.edit_layout);
 
         tabsButton = (ThemedImageButton) findViewById(R.id.tabs);
         tabsCounter = (TabCounter) findViewById(R.id.tabs_counter);
         if (Versions.feature11Plus) {
             tabsCounter.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
         }
 
-        menuButton = (ThemedImageButton) findViewById(R.id.menu);
+        menuButton = (ThemedFrameLayout) findViewById(R.id.menu);
         menuIcon = (ThemedImageView) findViewById(R.id.menu_icon);
         hasSoftMenuButton = !HardwareUtils.hasMenuButton();
 
         // The focusOrder List should be filled by sub-classes.
         focusOrder = new ArrayList<View>();
 
         final Resources res = getResources();
         shadowSize = res.getDimensionPixelSize(R.dimen.browser_toolbar_shadow_size);
@@ -319,18 +320,16 @@ public abstract class BrowserToolbar ext
 
                 toggleTabs();
             }
         });
         tabsButton.setImageLevel(0);
 
         if (hasSoftMenuButton) {
             menuButton.setVisibility(View.VISIBLE);
-            menuIcon.setVisibility(View.VISIBLE);
-
             menuButton.setOnClickListener(new Button.OnClickListener() {
                 @Override
                 public void onClick(View view) {
                     // Drop the soft keyboard.
                     urlEditLayout.clearFocus();
                     activity.openOptionsMenu();
                 }
             });