diff --git a/core/java/com/android/internal/view/menu/ListMenuPresenter.java b/core/java/com/android/internal/view/menu/ListMenuPresenter.java index e6538b0209503..014142729dc17 100644 --- a/core/java/com/android/internal/view/menu/ListMenuPresenter.java +++ b/core/java/com/android/internal/view/menu/ListMenuPresenter.java @@ -62,6 +62,7 @@ public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClick public ListMenuPresenter(Context context, int itemLayoutRes) { this(itemLayoutRes, 0); mContext = context; + mInflater = LayoutInflater.from(mContext); } /** @@ -78,10 +79,13 @@ public class ListMenuPresenter implements MenuPresenter, AdapterView.OnItemClick public void initForMenu(Context context, MenuBuilder menu) { if (mThemeRes != 0) { mContext = new ContextThemeWrapper(context, mThemeRes); + mInflater = LayoutInflater.from(mContext); } else if (mContext != null) { mContext = context; + if (mInflater == null) { + mInflater = LayoutInflater.from(mContext); + } } - mInflater = LayoutInflater.from(mContext); mMenu = menu; } diff --git a/core/res/res/layout/list_menu_item_layout.xml b/core/res/res/layout/list_menu_item_layout.xml index 93bd76b732de2..680eca79d0de9 100644 --- a/core/res/res/layout/list_menu_item_layout.xml +++ b/core/res/res/layout/list_menu_item_layout.xml @@ -26,8 +26,8 @@ android:layout_weight="1" android:layout_height="wrap_content" android:layout_gravity="center_vertical" - android:layout_marginLeft="16dip" - android:layout_marginRight="16dip" + android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft" + android:layout_marginRight="?android:attr/listPreferredItemPaddingRight" android:duplicateParentState="true"> @android:style/TextAppearance.Large.Inverse @android:style/TextAppearance.Medium.Inverse @android:style/TextAppearance.Small.Inverse + + 10dip + 10dip