Ellipsize texts in contacts list correctly
Measure correct width during onMeasure() so that each TextView
can decide if text should be ellipsized.
Also use View's padding mechanism instead of managing our own
padding values.
Bug: 5265348
Change-Id: I2696a6099ab176dd27117a802997d0cceb2ed153
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index d79d373..a95de0f 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -100,6 +100,8 @@
<attr name="list_item_contacts_count_text_color" format="color" />
<attr name="list_item_text_indent" format="dimension" />
<attr name="list_item_contacts_count_text_size" format="dimension" />
+ <attr name="list_item_data_width_weight" format="integer" />
+ <attr name="list_item_label_width_weight" format="integer" />
</declare-styleable>
<declare-styleable name="CallLog">
diff --git a/res/values/styles.xml b/res/values/styles.xml
index dd62594..d324d66 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -44,6 +44,8 @@
<item name="list_item_header_height">24dip</item>
<item name="list_item_header_underline_height">1dip</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_data_width_weight">5</item>
+ <item name="list_item_label_width_weight">3</item>
<item name="contact_browser_list_padding_left">16dip</item>
<item name="contact_browser_list_padding_right">0dip</item>
<item name="contact_browser_background">@android:color/transparent</item>
@@ -146,6 +148,8 @@
<item name="list_item_header_height">26dip</item>
<item name="list_item_header_underline_height">1dip</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_data_width_weight">5</item>
+ <item name="list_item_label_width_weight">3</item>
<item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
<item name="list_item_header_text_indent">8dip</item>
<item name="contact_browser_list_padding_left">16dip</item>