Bug 1132747 - Set the padding for share in the context menu on Lollipop. r=mhaigh
This commit is contained in:
@@ -38,7 +38,7 @@ public class MenuItemActionView extends LinearLayout
|
||||
|
||||
@TargetApi(14)
|
||||
public MenuItemActionView(Context context, AttributeSet attrs, int defStyle) {
|
||||
super(context, attrs);
|
||||
super(context, attrs, defStyle);
|
||||
|
||||
LayoutInflater.from(context).inflate(R.layout.menu_item_action_view, this);
|
||||
mMenuItem = (MenuItemDefault) findViewById(R.id.menu_item);
|
||||
@@ -165,4 +165,18 @@ public class MenuItemActionView extends LinearLayout
|
||||
listener.onClick(view);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the styles if this view is being used in the context menus.
|
||||
*
|
||||
* Ideally, we just use different layout files and styles to set this, but
|
||||
* MenuItemActionView is too integrated into GeckoActionProvider to provide
|
||||
* an easy separation so instead I provide this hack. I'm sorry.
|
||||
*/
|
||||
public void initContextMenuStyles() {
|
||||
final int defaultContextMenuPadding = getContext().getResources().getDimensionPixelOffset(
|
||||
R.dimen.context_menu_item_horizontal_padding);
|
||||
mMenuItem.setPadding(defaultContextMenuPadding, getPaddingTop(),
|
||||
defaultContextMenuPadding, getPaddingBottom());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user