Loading core/java/android/widget/ActionMenuPresenter.java +10 −6 Original line number Diff line number Diff line Loading @@ -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; Loading core/res/res/values/styles_material.xml +2 −2 Original line number Diff line number Diff line Loading @@ -874,8 +874,8 @@ please see styles_device_defaults.xml. <item name="contentDescription">@string/action_menu_overflow_description</item> <item name="minWidth">@dimen/action_button_min_width_overflow_material</item> <item name="minHeight">@dimen/action_button_min_height_material</item> <item name="paddingStart">0dp</item> <item name="paddingEnd">12dp</item> <item name="paddingStart">6dp</item> <item name="paddingEnd">10dp</item> </style> <style name="Widget.Material.ActionBar.TabView" parent="Widget.ActionBar.TabView"> Loading Loading
core/java/android/widget/ActionMenuPresenter.java +10 −6 Original line number Diff line number Diff line Loading @@ -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; Loading
core/res/res/values/styles_material.xml +2 −2 Original line number Diff line number Diff line Loading @@ -874,8 +874,8 @@ please see styles_device_defaults.xml. <item name="contentDescription">@string/action_menu_overflow_description</item> <item name="minWidth">@dimen/action_button_min_width_overflow_material</item> <item name="minHeight">@dimen/action_button_min_height_material</item> <item name="paddingStart">0dp</item> <item name="paddingEnd">12dp</item> <item name="paddingStart">6dp</item> <item name="paddingEnd">10dp</item> </style> <style name="Widget.Material.ActionBar.TabView" parent="Widget.ActionBar.TabView"> Loading