Bug 1233415 - Make action bar actions full action bar height. r?sebastian draft
authorTom Klein <twointofive@gmail.com>
Sat, 07 Jan 2017 02:33:14 -0600
changeset 457449 b1684900ec68dc7c8fe1ab66b8aea3c8a5700e5d
parent 453266 2785aaf276ba29fb2e1f5607d90d441fee42efb4
child 541472 d32bff3809b087950008c8b9450fce7b080961e1
push id40765
push userbmo:twointofive@gmail.com
push dateSun, 08 Jan 2017 21:27:37 +0000
reviewerssebastian
bugs1233415
milestone53.0a1
Bug 1233415 - Make action bar actions full action bar height. r?sebastian MozReview-Commit-ID: G78wgtWkfgQ
mobile/android/base/java/org/mozilla/gecko/ActionModeCompatView.java
mobile/android/base/resources/values-v11/styles.xml
--- a/mobile/android/base/java/org/mozilla/gecko/ActionModeCompatView.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ActionModeCompatView.java
@@ -142,16 +142,18 @@ class ActionModeCompatView extends Linea
             }
         }
 
         actionItem.measure(SPEC, SPEC);
         int w = actionItem.getMeasuredWidth();
         if (mActionButtonsWidth + w < maxWidth) {
             // We cache the new width of our children.
             mActionButtonsWidth += w;
+            // Make sure the actionItem scales to the full height of the button bar.
+            actionItem.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.MATCH_PARENT));
             mActionButtonBar.addView(actionItem);
             return true;
         }
 
         return false;
     }
 
     /* GeckoMenu.ActionItemBarPresenter */
--- a/mobile/android/base/resources/values-v11/styles.xml
+++ b/mobile/android/base/resources/values-v11/styles.xml
@@ -82,17 +82,19 @@
              counterpart. This is solely to correct bug 1233709 -->
         <item name="android:gravity">center_vertical</item>
         <item name="android:minWidth">0dp</item>
     </style>
 
     <style name="GeckoActionBar.Button" parent="android:style/Widget.Holo.Light.ActionButton">
         <item name="android:padding">8dip</item>
         <!-- The default implementation doesn't do any image scaling. Our custom menus mean we can't just use the same image
-             in both menus and the actionbar without doing some scaling though. -->
+             in both menus and the actionbar without doing some scaling though. Users may also want to set
+             layout_height="match_parent" to make sure buttons are scaled to full action bar height - setting it here
+             doesn't work. -->
         <item name="android:scaleType">centerInside</item>
     </style>
 
     <style name="GeckoActionBar.Button.MenuButton" parent="android:style/Widget.Holo.Light.ActionButton.Overflow">
         <item name="android:scaleType">centerInside</item>
         <item name="android:background">@android:color/transparent</item>
         <item name="android:src">@drawable/menu</item>
         <item name="android:tint">@color/toolbar_icon_grey</item>