diff --git a/core/java/android/widget/ActionMenuPresenter.java b/core/java/android/widget/ActionMenuPresenter.java index d77912440beb8..18f15a0ababa0 100644 --- a/core/java/android/widget/ActionMenuPresenter.java +++ b/core/java/android/widget/ActionMenuPresenter.java @@ -655,15 +655,19 @@ public class ActionMenuPresenter extends BaseMenuPresenter protected boolean setFrame(int l, int t, int r, int b) { final boolean changed = super.setFrame(l, t, r, b); - // Set up the hotspot bounds to be centered on the image. + // Set up the hotspot bounds to square and centered on the image. final Drawable d = getDrawable(); final Drawable bg = getBackground(); if (d != null && bg != null) { - final float[] pts = mTempPts; - pts[0] = d.getBounds().centerX(); - getImageMatrix().mapPoints(pts); - final int offset = (int) pts[0] - getWidth() / 2; - bg.setHotspotBounds(offset, 0, getWidth() + offset, getHeight()); + final int width = getWidth(); + final int height = getHeight(); + final int halfEdge = Math.max(width, height) / 2; + final int offsetX = getPaddingLeft() - getPaddingRight(); + final int offsetY = getPaddingTop() - getPaddingBottom(); + final int centerX = (width + offsetX) / 2; + final int centerY = (height + offsetY) / 2; + bg.setHotspotBounds(centerX - halfEdge, centerY - halfEdge, + centerX + halfEdge, centerY + halfEdge); } return changed; diff --git a/core/res/res/values/styles_material.xml b/core/res/res/values/styles_material.xml index 6749441afd50f..c7e9ec92fc7e4 100644 --- a/core/res/res/values/styles_material.xml +++ b/core/res/res/values/styles_material.xml @@ -874,8 +874,8 @@ please see styles_device_defaults.xml. @string/action_menu_overflow_description @dimen/action_button_min_width_overflow_material @dimen/action_button_min_height_material - 0dp - 12dp + 6dp + 10dp