summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2011-09-13 16:02:38 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-13 16:02:38 -0700
commite0946eb270e669ac470467dbda033a443ee5d1cc (patch)
tree48c4c6a54d7ee048a68a7ccb2573b1a01cf8a525
parent03c2a00507b35e7cb5c5f5efa81c94b663cf68dd (diff)
parentbc835039994f8fe70e37041a29d21335a2e22479 (diff)
downloadframeworks_base-e0946eb270e669ac470467dbda033a443ee5d1cc.zip
frameworks_base-e0946eb270e669ac470467dbda033a443ee5d1cc.tar.gz
frameworks_base-e0946eb270e669ac470467dbda033a443ee5d1cc.tar.bz2
Merge "Fix bug 5307916 - legacy menu theming"
-rw-r--r--core/java/com/android/internal/view/menu/ListMenuPresenter.java6
-rw-r--r--core/res/res/layout/list_menu_item_layout.xml4
-rw-r--r--core/res/res/values/themes.xml5
3 files changed, 12 insertions, 3 deletions
diff --git a/core/java/com/android/internal/view/menu/ListMenuPresenter.java b/core/java/com/android/internal/view/menu/ListMenuPresenter.java
index e6538b0..0141427 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 93bd76b..680eca7 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">
<TextView
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index c8f7fb8..3378dc8 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -616,6 +616,9 @@ please see themes_device_defaults.xml.
<item name="textAppearanceLargeInverse">@android:style/TextAppearance.Large.Inverse</item>
<item name="textAppearanceMediumInverse">@android:style/TextAppearance.Medium.Inverse</item>
<item name="textAppearanceSmallInverse">@android:style/TextAppearance.Small.Inverse</item>
+
+ <item name="listPreferredItemPaddingLeft">10dip</item>
+ <item name="listPreferredItemPaddingRight">10dip</item>
</style>
<!-- Variation of Theme.Dialog that does not include a frame (or background).
@@ -640,6 +643,8 @@ please see themes_device_defaults.xml.
<item name="windowTitleStyle">@android:style/DialogWindowTitle</item>
<item name="windowContentOverlay">@null</item>
<item name="itemTextAppearance">@android:style/TextAppearance.Large.Inverse</item>
+ <item name="textAppearanceListItem">@android:style/TextAppearance.Large.Inverse</item>
+ <item name="textAppearanceListItemSmall">@android:style/TextAppearance.Large.Inverse</item>
</style>
<!-- Default dark theme for panel windows. This removes all extraneous