From 7c8375d65218f68aa5e48f86cee2dd0ee9114bb5 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Fri, 9 Sep 2011 14:01:55 -0700 Subject: Bug 5214224 - List item metrics Base list item padding on the theme. Adjust stock framework list items to obey this. Adjust text sizes in stock list items based on existing theme attributes. Change-Id: I98a441e5494fa1d1d34a5f05e525e54e8b0d78b9 --- api/current.txt | 2 ++ core/res/res/layout/activity_list_item.xml | 2 +- core/res/res/layout/activity_list_item_2.xml | 2 +- core/res/res/layout/resolve_list_item.xml | 12 ++++++------ core/res/res/layout/simple_list_item_1.xml | 8 ++++---- core/res/res/layout/simple_list_item_2.xml | 6 +++--- core/res/res/layout/simple_list_item_activated_1.xml | 6 ++++-- core/res/res/layout/simple_list_item_activated_2.xml | 6 +++--- core/res/res/layout/simple_list_item_checked.xml | 8 ++++---- core/res/res/layout/simple_list_item_single_choice.xml | 8 ++++---- core/res/res/layout/simple_spinner_item.xml | 2 +- core/res/res/values/attrs.xml | 5 +++++ core/res/res/values/public.xml | 12 ++++++++---- core/res/res/values/themes.xml | 6 ++++++ 14 files changed, 52 insertions(+), 33 deletions(-) diff --git a/api/current.txt b/api/current.txt index 019ea3c463ed..950a4aa0b6f4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -644,6 +644,8 @@ package android { field public static final int listPreferredItemHeight = 16842829; // 0x101004d field public static final int listPreferredItemHeightLarge = 16843668; // 0x1010394 field public static final int listPreferredItemHeightSmall = 16843669; // 0x1010395 + field public static final int listPreferredItemPaddingLeft = 16843697; // 0x10103b1 + field public static final int listPreferredItemPaddingRight = 16843698; // 0x10103b2 field public static final int listSelector = 16843003; // 0x10100fb field public static final int listSeparatorTextViewStyle = 16843272; // 0x1010208 field public static final int listViewStyle = 16842868; // 0x1010074 diff --git a/core/res/res/layout/activity_list_item.xml b/core/res/res/layout/activity_list_item.xml index 7022fe1858e3..572caf020604 100644 --- a/core/res/res/layout/activity_list_item.xml +++ b/core/res/res/layout/activity_list_item.xml @@ -33,6 +33,6 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:paddingLeft="6dip" /> + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" /> diff --git a/core/res/res/layout/activity_list_item_2.xml b/core/res/res/layout/activity_list_item_2.xml index 3b84c733e450..a58ebfce7810 100644 --- a/core/res/res/layout/activity_list_item_2.xml +++ b/core/res/res/layout/activity_list_item_2.xml @@ -18,7 +18,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?android:attr/listPreferredItemHeight" - android:textAppearance="?android:attr/textAppearanceMedium" + android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" android:drawablePadding="14dip" android:paddingLeft="16dip" diff --git a/core/res/res/layout/resolve_list_item.xml b/core/res/res/layout/resolve_list_item.xml index 66e3b8a62e24..c0404be5e003 100644 --- a/core/res/res/layout/resolve_list_item.xml +++ b/core/res/res/layout/resolve_list_item.xml @@ -23,8 +23,8 @@ android:minHeight="?android:attr/listPreferredItemHeight" android:layout_height="wrap_content" android:layout_width="match_parent" - android:paddingLeft="10dip" - android:paddingRight="15dip"> + android:paddingLeft="16dip" + android:paddingRight="16dip"> + android:paddingLeft="16dip" /> + android:paddingLeft="16dip" /> diff --git a/core/res/res/layout/simple_list_item_1.xml b/core/res/res/layout/simple_list_item_1.xml index 252e006a307f..c5e3efc7e80a 100644 --- a/core/res/res/layout/simple_list_item_1.xml +++ b/core/res/res/layout/simple_list_item_1.xml @@ -18,9 +18,9 @@ android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceListItem" + android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" - android:paddingLeft="8dip" - android:paddingRight="8dip" - android:minHeight="?android:attr/listPreferredItemHeight" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" + android:minHeight="?android:attr/listPreferredItemHeightSmall" /> diff --git a/core/res/res/layout/simple_list_item_2.xml b/core/res/res/layout/simple_list_item_2.xml index 9b6c62a707fe..936987687e38 100644 --- a/core/res/res/layout/simple_list_item_2.xml +++ b/core/res/res/layout/simple_list_item_2.xml @@ -24,8 +24,8 @@ @@ -33,7 +33,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@android:id/text1" - android:layout_alignLeft="@android:id/text1" + android:layout_alignLeft="@android:id/text1" android:textAppearance="?android:attr/textAppearanceSmall" /> diff --git a/core/res/res/layout/simple_list_item_activated_1.xml b/core/res/res/layout/simple_list_item_activated_1.xml index d60f93b46a86..a5fb5d1f667a 100644 --- a/core/res/res/layout/simple_list_item_activated_1.xml +++ b/core/res/res/layout/simple_list_item_activated_1.xml @@ -18,8 +18,10 @@ android:id="@android:id/text1" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textAppearance="?android:attr/textAppearanceListItem" + android:textAppearance="?android:attr/textAppearanceListItemSmall" android:gravity="center_vertical" + android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" + android:paddingRight="?android:attr/listPreferredItemPaddingRight" android:background="?android:attr/activatedBackgroundIndicator" - android:minHeight="?android:attr/listPreferredItemHeight" + android:minHeight="?android:attr/listPreferredItemHeightSmall" /> diff --git a/core/res/res/layout/simple_list_item_activated_2.xml b/core/res/res/layout/simple_list_item_activated_2.xml index 5be5c9220547..8746f6f86039 100644 --- a/core/res/res/layout/simple_list_item_activated_2.xml +++ b/core/res/res/layout/simple_list_item_activated_2.xml @@ -27,9 +27,9 @@ diff --git a/core/res/res/layout/simple_list_item_single_choice.xml b/core/res/res/layout/simple_list_item_single_choice.xml index ac4a4a8cfa35..4a6cefadd1b0 100644 --- a/core/res/res/layout/simple_list_item_single_choice.xml +++ b/core/res/res/layout/simple_list_item_single_choice.xml @@ -17,10 +17,10 @@ diff --git a/core/res/res/layout/simple_spinner_item.xml b/core/res/res/layout/simple_spinner_item.xml index 77929eee8f9b..61dc02527f69 100644 --- a/core/res/res/layout/simple_spinner_item.xml +++ b/core/res/res/layout/simple_spinner_item.xml @@ -19,7 +19,7 @@ --> + + + + + diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index bc2b907c89cf..50dee12eeb40 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1798,6 +1798,14 @@ + + + + + + + + @@ -2007,8 +2015,4 @@ - - - - diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index cc7900610e34..dae808ae3469 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -124,6 +124,8 @@ please see themes_device_defaults.xml. ?android:attr/listPreferredItemHeight ?android:attr/textAppearanceLarge ?android:attr/textAppearanceLarge + 6dip + 6dip 58dip @@ -924,6 +926,8 @@ please see themes_device_defaults.xml. 80dip ?android:attr/listPreferredItemHeightSmall ?android:attr/textAppearanceMedium + 8dip + 8dip 58dip @@ -1229,6 +1233,8 @@ please see themes_device_defaults.xml. 80dip ?android:attr/listPreferredItemHeightSmall ?android:attr/textAppearanceMedium + 8dip + 8dip 58dip -- cgit v1.2.3-59-g8ed1b