Bug 1233415 - Make action bar actions full action bar height. r?sebastian
MozReview-Commit-ID: G78wgtWkfgQ
--- 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>