summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adam Powell <adamp@google.com> 2011-09-09 14:01:55 -0700
committer Adam Powell <adamp@google.com> 2011-09-09 14:41:37 -0700
commit7c8375d65218f68aa5e48f86cee2dd0ee9114bb5 (patch)
treeef8c9fef5a0f2f36e3ac35c2c9cbca8cc0cee3d4
parentd67ff5c41d9267dab101f46476474813eb94bfa4 (diff)
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
-rw-r--r--api/current.txt2
-rw-r--r--core/res/res/layout/activity_list_item.xml2
-rw-r--r--core/res/res/layout/activity_list_item_2.xml2
-rw-r--r--core/res/res/layout/resolve_list_item.xml12
-rw-r--r--core/res/res/layout/simple_list_item_1.xml8
-rw-r--r--core/res/res/layout/simple_list_item_2.xml6
-rw-r--r--core/res/res/layout/simple_list_item_activated_1.xml6
-rw-r--r--core/res/res/layout/simple_list_item_activated_2.xml6
-rw-r--r--core/res/res/layout/simple_list_item_checked.xml8
-rw-r--r--core/res/res/layout/simple_list_item_single_choice.xml8
-rw-r--r--core/res/res/layout/simple_spinner_item.xml2
-rwxr-xr-xcore/res/res/values/attrs.xml5
-rw-r--r--core/res/res/values/public.xml12
-rw-r--r--core/res/res/values/themes.xml6
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" />
</LinearLayout>
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">
<!-- Activity icon when presenting dialog -->
<ImageView android:id="@+id/icon"
@@ -39,18 +39,18 @@
android:layout_height="wrap_content" >
<!-- Activity name -->
<TextView android:id="@android:id/text1"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
- android:paddingLeft="10dip" />
+ android:paddingLeft="16dip" />
<!-- Extended activity info to distinguish between duplicate activity names -->
<TextView android:id="@android:id/text2"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
- android:paddingLeft="10dip" />
+ android:paddingLeft="16dip" />
</LinearLayout>
</LinearLayout>
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 @@
<TextView android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="8dip"
- android:layout_marginTop="8dip"
+ android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft"
+ android:layout_marginTop="8dip"
android:textAppearance="?android:attr/textAppearanceListItem"
/>
@@ -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 @@
<TextView android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="8dip"
- android:layout_marginTop="8dip"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft"
+ android:layout_marginTop="6dip"
+ android:textAppearance="?android:attr/textAppearanceListItem"
/>
<TextView android:id="@android:id/text2"
diff --git a/core/res/res/layout/simple_list_item_checked.xml b/core/res/res/layout/simple_list_item_checked.xml
index 79d3a18464e1..c9153f850c2b 100644
--- a/core/res/res/layout/simple_list_item_checked.xml
+++ b/core/res/res/layout/simple_list_item_checked.xml
@@ -17,10 +17,10 @@
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:textAppearance="?android:attr/textAppearanceListItem"
+ android:layout_height="?android:attr/listPreferredItemHeightSmall"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/textCheckMark"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
+ android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
+ android:paddingRight="?android:attr/listPreferredItemPaddingRight"
/>
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 @@
<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:textAppearance="?android:attr/textAppearanceListItem"
+ android:layout_height="?android:attr/listPreferredItemHeightSmall"
+ android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
+ android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
+ android:paddingRight="?android:attr/listPreferredItemPaddingRight"
/>
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 @@
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
- style="?android:attr/spinnerItemStyle"
+ style="?android:attr/spinnerItemStyle"
android:singleLine="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index bc14adebbed0..525b03ae9ac3 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -235,6 +235,11 @@
<!-- The list item height for search results. @hide -->
<attr name="searchResultListItemHeight" format="dimension" />
+ <!-- The preferred padding along the left edge of list items. -->
+ <attr name="listPreferredItemPaddingLeft" format="dimension" />
+ <!-- The preferred padding along the right edge of list items. -->
+ <attr name="listPreferredItemPaddingRight" format="dimension" />
+
<!-- The preferred TextAppearance for the primary text of list items. -->
<attr name="textAppearanceListItem" format="reference" />
<!-- The preferred TextAppearance for the primary text of small list items. -->
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 @@
<public type="attr" name="textAppearanceListItem" />
<public type="attr" name="textAppearanceListItemSmall" />
+ <public type="attr" name="targetDescriptions" />
+ <public type="attr" name="directionDescriptions" />
+
+ <public type="attr" name="overridesImplicitlyEnabledSubtype" />
+
+ <public type="attr" name="listPreferredItemPaddingLeft" />
+ <public type="attr" name="listPreferredItemPaddingRight" />
+
<public type="style" name="TextAppearance.SuggestionHighlight" />
<public type="style" name="Theme.Holo.Light.DarkActionBar" />
@@ -2007,8 +2015,4 @@
<public type="color" name="holo_purple" />
<public type="color" name="holo_blue_bright" />
- <public type="attr" name="targetDescriptions" />
- <public type="attr" name="directionDescriptions" />
-
- <public type="attr" name="overridesImplicitlyEnabledSubtype" />
</resources>
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.
<item name="dropdownListPreferredItemHeight">?android:attr/listPreferredItemHeight</item>
<item name="textAppearanceListItem">?android:attr/textAppearanceLarge</item>
<item name="textAppearanceListItemSmall">?android:attr/textAppearanceLarge</item>
+ <item name="listPreferredItemPaddingLeft">6dip</item>
+ <item name="listPreferredItemPaddingRight">6dip</item>
<!-- @hide -->
<item name="searchResultListItemHeight">58dip</item>
@@ -924,6 +926,8 @@ please see themes_device_defaults.xml.
<item name="listPreferredItemHeightLarge">80dip</item>
<item name="dropdownListPreferredItemHeight">?android:attr/listPreferredItemHeightSmall</item>
<item name="textAppearanceListItemSmall">?android:attr/textAppearanceMedium</item>
+ <item name="listPreferredItemPaddingLeft">8dip</item>
+ <item name="listPreferredItemPaddingRight">8dip</item>
<!-- @hide -->
<item name="searchResultListItemHeight">58dip</item>
@@ -1229,6 +1233,8 @@ please see themes_device_defaults.xml.
<item name="listPreferredItemHeightLarge">80dip</item>
<item name="dropdownListPreferredItemHeight">?android:attr/listPreferredItemHeightSmall</item>
<item name="textAppearanceListItemSmall">?android:attr/textAppearanceMedium</item>
+ <item name="listPreferredItemPaddingLeft">8dip</item>
+ <item name="listPreferredItemPaddingRight">8dip</item>
<!-- @hide -->
<item name="searchResultListItemHeight">58dip</item>