Contact picker/group list pixel-perfect

There are still a few issues to be fixed around picker
stuff, but it looks basically fine enough.

- fix misc padding issues around contact listing itself
- introduce conditional padding for phone search view to keep
  top padding consistency
- keep consistency between group and contact listing
- remove "groups per account" count
- stop showing quick scroll bar in group list

Bug: 5137457
Bug: 5144140
Bug: 5143350
Bug: 5080599
Change-Id: I038c112bbf9e956e9a2b784178c0360d03e3f333
diff --git a/res/layout-sw580dp/contact_picker_content.xml b/res/layout-sw580dp/contact_picker_content.xml
deleted file mode 100644
index 225b725..0000000
--- a/res/layout-sw580dp/contact_picker_content.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical">
-
-    <View
-        android:layout_width="match_parent"
-        android:layout_height="2dip"
-        android:layout_marginTop="1dip"
-        android:layout_marginBottom="1dip"
-        android:background="#7e7e87" />
-
-    <view
-        class="com.android.contacts.list.ContactEntryListView"
-        android:id="@android:id/list"
-        android:layout_width="match_parent"
-        android:layout_height="0dip"
-        android:fastScrollEnabled="true"
-        android:layout_weight="1"/>
-
-    <ViewStub
-        android:id="@+id/footer_stub"
-        android:layout="@layout/footer_panel"
-        android:layout_width="fill_parent"
-        android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index ccfa01d..e292f39 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -24,8 +24,8 @@
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:gravity="center_vertical"
-    android:paddingTop="12dip"
-    android:paddingBottom="12dip"
+    android:paddingTop="8dip"
+    android:paddingBottom="8dip"
     android:minHeight="@dimen/detail_min_line_item_height">
 
     <!-- Note: padding might be controlled programatically -->
diff --git a/res/layout/contact_detail_list_padding.xml b/res/layout/contact_detail_list_padding.xml
new file mode 100644
index 0000000..8095731
--- /dev/null
+++ b/res/layout/contact_detail_list_padding.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- The actual padding is embedded in a FrameLayout since we cannot change the
+     visibility of a header view in a ListView without having a parent view. -->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content">
+    <View
+        android:id="@+id/contact_detail_list_padding"
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/contact_browser_list_top_margin" />
+</FrameLayout>
+
diff --git a/res/layout/contact_picker.xml b/res/layout/contact_picker.xml
index c3fe2fa..96bf334 100644
--- a/res/layout/contact_picker.xml
+++ b/res/layout/contact_picker.xml
@@ -18,8 +18,6 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     class="com.android.contacts.widget.FullHeightLinearLayout"
     style="@style/ContactPickerLayout"
-    android:paddingLeft="8dip"
-    android:paddingRight="8dip"
     android:orientation="vertical"
     android:layout_height="match_parent">
     <view
@@ -27,18 +25,18 @@
         android:id="@+id/search_view"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="10dip"
-        android:layout_marginRight="10dip"
-        android:layout_marginBottom="10dip"
+        android:layout_marginLeft="0dip"
+        android:layout_marginRight="32dip"
         android:iconifiedByDefault="false" />
+    <!-- will contain an appropriate contacts list -->
     <FrameLayout
+        android:id="@+id/list_container"
         android:layout_width="match_parent"
         android:layout_height="0dip"
-        android:layout_weight="1"
-        android:id="@+id/list_container">
-    </FrameLayout>
+        android:layout_weight="1" />
 
     <View
+        android:id="@+id/divider"
         android:layout_width="match_parent"
         android:layout_height="1dip"
         android:layout_marginLeft="16dip"
@@ -48,7 +46,9 @@
     <LinearLayout
         style="?android:attr/buttonBarStyle"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:paddingLeft="16dip"
+        android:paddingRight="16dip">
         <Button
             style="?android:attr/buttonBarButtonStyle"
             android:id="@+id/cancel"
diff --git a/res/layout/contact_picker_content.xml b/res/layout/contact_picker_content.xml
index 6792f9c..c30add7 100644
--- a/res/layout/contact_picker_content.xml
+++ b/res/layout/contact_picker_content.xml
@@ -26,6 +26,8 @@
         android:id="@android:id/list"
         android:layout_width="match_parent"
         android:layout_height="0dip"
+        android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+        android:layout_marginRight="?attr/contact_browser_list_padding_right"
         android:fastScrollEnabled="true"
         android:layout_weight="1" />
 
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index f98d751..66c3936 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -22,17 +22,19 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/pinned_header_list_layout"
-    android:paddingTop="@dimen/contact_browser_list_top_margin"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent" >
 
-    <!-- Shown only when an Account filter is set. -->
+    <!-- Shown only when an Account filter is set.
+         - paddingTop should be here to show "shade" effect correctly. -->
     <LinearLayout
         android:id="@+id/account_filter_header_container"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:minHeight="?attr/list_item_header_height"
         android:orientation="vertical"
+        android:paddingTop="@dimen/contact_browser_list_top_margin"
         android:layout_marginLeft="@dimen/contact_browser_list_header_left_margin"
         android:layout_marginRight="@dimen/contact_browser_list_header_right_margin"
         android:visibility="gone">
@@ -40,11 +42,9 @@
             android:id="@+id/account_filter_header"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:minHeight="@dimen/contact_filter_header_min_height"
             android:singleLine="true"
             android:ellipsize="end"
             android:textStyle="bold"
-            android:gravity="left|center_vertical"
             android:textAllCaps="true"
             android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
             android:textAppearance="?android:attr/textAppearanceSmall"
@@ -59,9 +59,9 @@
         class="com.android.contacts.list.ContactEntryListView"
         android:id="@android:id/list"
         android:layout_width="match_parent"
-           android:layout_height="0dip"
-           android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
-        android:layout_marginRight="@dimen/contact_browser_list_right_margin"
+        android:layout_height="0dip"
+        android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+        android:layout_marginRight="?attr/contact_browser_list_padding_right"
         android:fastScrollEnabled="true"
         android:layout_weight="1" />
 
diff --git a/res/layout/directory_header.xml b/res/layout/directory_header.xml
index af0b5bd..6043c7b 100644
--- a/res/layout/directory_header.xml
+++ b/res/layout/directory_header.xml
@@ -19,12 +19,14 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     style="@style/DirectoryHeader"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content">
+    android:layout_height="wrap_content"
+    android:minHeight="?attr/list_item_header_height"
+    android:paddingLeft="?attr/list_item_padding_left"
+    android:paddingRight="?attr/list_item_padding_right">
     <TextView
         android:id="@+id/display_name"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:minHeight="@dimen/directory_header_height"
         android:layout_toRightOf="@+id/label"
         android:layout_toLeftOf="@+id/count"
         android:layout_centerVertical="true"
@@ -32,7 +34,9 @@
         android:layout_marginRight="8dip"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textColor="?android:attr/textColorSecondary"
-        android:singleLine="true" />
+        android:singleLine="true"
+        android:textStyle="bold"
+        android:textAllCaps="true" />
     <TextView
         android:id="@+id/label"
         android:layout_width="wrap_content"
@@ -41,16 +45,19 @@
         android:layout_alignBaseline="@id/display_name"
         android:layout_marginLeft="8dip"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textColor="?android:attr/textColorSecondary" />
+        android:textColor="?android:attr/textColorSecondary"
+        android:singleLine="true"
+        android:textStyle="bold"
+        android:textAllCaps="true" />
     <TextView
         android:id="@+id/count"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_alignParentRight="true"
-        android:layout_marginRight="8dip"
         android:layout_alignBaseline="@id/display_name"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textColor="?android:attr/textColorSecondary" />
+        android:singleLine="true"
+        android:textSize="12sp"
+        android:textColor="@color/contact_count_text_color" />
     <View
         android:id="@+id/contact_filter_header_bottom_divider"
         style="@style/SectionDivider"
diff --git a/res/layout/group_browse_list_account_header.xml b/res/layout/group_browse_list_account_header.xml
index f739ea2..b1d873d 100644
--- a/res/layout/group_browse_list_account_header.xml
+++ b/res/layout/group_browse_list_account_header.xml
@@ -18,54 +18,43 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:background="@drawable/list_background_holo"
-    android:paddingLeft="@dimen/group_list_header_padding"
-    android:paddingRight="@dimen/group_list_header_padding"
-    android:paddingTop="@dimen/group_list_header_padding"
+    android:minHeight="?attr/list_item_header_height"
     android:orientation="vertical">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:paddingLeft="?attr/list_item_header_text_indent"
         android:orientation="horizontal">
 
         <TextView
             android:id="@+id/account_type"
-            android:layout_width="wrap_content"
+            android:layout_width="0px"
             android:layout_height="wrap_content"
-            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_weight="1"
+            android:textAppearance="?android:attr/textAppearanceSmall"
             android:textColor="@color/people_app_theme_color"
             android:textStyle="bold"
             android:textAllCaps="true"
             android:singleLine="true"/>
 
+        <!-- TODO: Shold use correct color with a correct name (content should be same).
+             can use "?android:attr/textColorTertiary" -->
         <TextView
             android:id="@+id/account_name"
-            android:layout_width="0dip"
-            android:layout_height="wrap_content"
-            android:layout_weight="1"
-            android:layout_marginLeft="@dimen/group_list_header_padding"
-            android:textAppearance="?android:attr/textAppearanceSmall"
-            android:singleLine="true"
-            android:ellipsize="middle"
-            android:textColor="@color/people_app_theme_color"/>
-
-        <TextView
-            android:id="@+id/group_count"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:gravity="right"
-            android:singleLine="true"
-            android:layout_marginLeft="@dimen/group_list_header_padding"
+            android:layout_gravity="center_vertical"
             android:textAppearance="?android:attr/textAppearanceSmall"
-            android:textColor="?android:attr/textColorTertiary"/>
-
+            android:textColor="@color/contact_count_text_color"
+            android:textSize="12sp"
+            android:singleLine="true"
+            android:ellipsize="middle" />
     </LinearLayout>
 
     <View
         android:layout_width="match_parent"
         android:layout_height="1dip"
-        android:layout_marginTop="@dimen/group_list_header_padding"
-        android:background="@color/people_app_theme_color"/>
+        android:background="@color/people_app_theme_color" />
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/group_browse_list_fragment.xml b/res/layout/group_browse_list_fragment.xml
index 9e6bd27..6e82e8f 100644
--- a/res/layout/group_browse_list_fragment.xml
+++ b/res/layout/group_browse_list_fragment.xml
@@ -25,20 +25,23 @@
       class="com.android.contacts.widget.AutoScrollListView"
       android:layout_width="match_parent"
       android:layout_height="0dip"
-      android:fastScrollEnabled="true"
+      android:paddingTop="@dimen/contact_browser_list_top_margin"
+      android:paddingLeft="16dip"
+      android:paddingRight="16dip"
       android:scrollbarStyle="outsideOverlay"
       android:layout_weight="1"
       android:cacheColorHint="@android:color/transparent"
       android:divider="@null" />
 
     <TextView
-      android:id="@+id/empty"
-      android:layout_marginTop="@dimen/empty_message_top_margin"
-      android:layout_width="match_parent"
-      android:layout_height="wrap_content"
-      android:gravity="center_horizontal"
-      android:textAppearance="?android:attr/textAppearanceMedium"
-      android:text="@string/noGroups" />
+        android:id="@+id/empty"
+        android:layout_marginTop="@dimen/empty_message_top_margin"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingTop="8dip"
+        android:gravity="center_horizontal"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:text="@string/noGroups" />
 
     <LinearLayout
       android:id="@+id/add_accounts"
diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml
index 326b413..599cc13 100644
--- a/res/layout/group_browse_list_item.xml
+++ b/res/layout/group_browse_list_item.xml
@@ -19,35 +19,33 @@
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:minHeight="@dimen/detail_min_line_item_height">
+    android:paddingLeft="?attr/list_item_padding_left"
+    android:paddingTop="?attr/list_item_padding_top"
+    android:paddingRight="?attr/list_item_padding_right"
+    android:paddingBottom="?attr/list_item_padding_bottom"
+    android:minHeight="@dimen/detail_min_line_item_height" >
 
-    <ImageView
+    <View
         android:id="@+id/divider"
         android:layout_width="match_parent"
         android:layout_height="1dip"
-        android:paddingLeft="10dip"
-        android:paddingRight="10dip"
-        android:scaleType="fitXY"
-        android:src="@color/people_app_theme_color"/>
+        android:background="?android:attr/listDivider" />
 
     <include
         android:id="@+id/group_list_header"
         layout="@layout/group_browse_list_account_header"
-        android:paddingRight="20dip"
-        android:paddingBottom="10dip"
         android:visibility="gone" />
 
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingTop="10dip"
-        android:paddingRight="20dip"
-        android:paddingBottom="10dip"
-        style="@style/GroupBrowseListItem">
+        android:paddingTop="8dip"
+        android:paddingBottom="8dip">
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
+            android:paddingLeft="?attr/list_item_text_indent"
             android:orientation="vertical"
             android:layout_toLeftOf="@+id/icons"
             android:layout_alignParentLeft="true"
@@ -57,8 +55,6 @@
                 android:id="@+id/label"
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:paddingLeft="10dip"
-                android:paddingRight="10dip"
                 android:textAppearance="?android:attr/textAppearanceMedium"
                 android:ellipsize="end"
                 android:singleLine="true" />
@@ -67,8 +63,6 @@
                 android:id="@+id/count"
                 android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:paddingLeft="10dip"
-                android:paddingRight="10dip"
                 android:textAppearance="?android:attr/textAppearanceSmall"
                 android:textColor="?android:attr/textColorTertiary"
                 android:ellipsize="end"
diff --git a/res/layout/join_contact_picker.xml b/res/layout/join_contact_picker.xml
index 20a7740..ffea137 100644
--- a/res/layout/join_contact_picker.xml
+++ b/res/layout/join_contact_picker.xml
@@ -24,20 +24,22 @@
         android:layout_width="match_parent"
         android:layout_height="0dip"
         android:layout_weight="1"
-        android:id="@+id/list_container">
-    </FrameLayout>
+        android:id="@+id/list_container" />
 
     <View
+        android:id="@+id/divider"
         android:layout_width="match_parent"
         android:layout_height="1dip"
-        android:layout_marginLeft="16dip"
-        android:layout_marginRight="16dip"
+        android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+        android:layout_marginRight="?attr/contact_browser_list_padding_right"
         android:background="?android:attr/dividerHorizontal" />
 
     <LinearLayout
         style="?android:attr/buttonBarStyle"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+        android:layout_marginRight="?attr/contact_browser_list_padding_right">
         <Button
             style="?android:attr/buttonBarButtonStyle"
             android:id="@+id/cancel"
diff --git a/res/layout/join_contact_picker_list_content.xml b/res/layout/join_contact_picker_list_content.xml
index 0d2a089..9e72c31 100644
--- a/res/layout/join_contact_picker_list_content.xml
+++ b/res/layout/join_contact_picker_list_content.xml
@@ -19,33 +19,30 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:paddingTop="8dip"
     android:orientation="vertical">
 
     <TextView
         android:id="@+id/join_contact_blurb"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:paddingLeft="10dip"
-        android:paddingTop="12dip"
-        android:paddingBottom="12dip"
-        android:layout_marginLeft="12dip"
-        android:layout_marginRight="12dip"
+        android:paddingLeft="16dip"
+        android:paddingRight="16dip"
         android:maxLines="2"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textColor="?android:attr/textColorSecondary" />
+        android:textAppearance="?android:attr/textAppearanceMedium" />
 
     <FrameLayout
         android:id="@+id/pinned_header_list_layout"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_marginLeft="48dip"
-        android:layout_marginRight="48dip">
-
+        android:layout_height="match_parent">
         <view
             class="com.android.contacts.list.ContactEntryListView"
             android:id="@android:id/list"
             android:layout_width="match_parent"
             android:layout_height="match_parent"
-            android:fastScrollEnabled="true" />
+            android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+            android:layout_marginRight="?attr/contact_browser_list_padding_right"
+            android:fastScrollEnabled="true"
+            android:scrollbarStyle="outsideOverlay" />
     </FrameLayout>
 </LinearLayout>
diff --git a/res/layout/join_contact_picker_section.xml b/res/layout/join_contact_picker_section.xml
index 95ec107..260ea2d 100644
--- a/res/layout/join_contact_picker_section.xml
+++ b/res/layout/join_contact_picker_section.xml
@@ -22,12 +22,12 @@
 
     <TextView
         android:id="@+id/text"
-        android:layout_height="32dip"
         android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingLeft="?attr/list_item_header_text_indent"
+        android:minHeight="16dip"
         android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textColor="?android:attr/textColorSecondary"
         android:gravity="center_vertical" />
 
-    <View
-        style="@style/SectionDivider" />
+    <View style="@style/SectionDivider" />
 </LinearLayout>
diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
index 4937d7b..8735f5a 100644
--- a/res/layout/user_profile_button.xml
+++ b/res/layout/user_profile_button.xml
@@ -18,11 +18,13 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
+    android:minHeight="@dimen/contact_browser_list_item_photo_size"
+    android:layout_marginLeft="?attr/list_item_padding_left"
+    android:layout_marginRight="?attr/list_item_padding_right"
+    android:paddingLeft="?attr/list_item_header_text_indent"
     android:background="?android:attr/selectableItemBackground"
     android:singleLine="true"
     android:text="@string/profile_display_name"
     android:ellipsize="end"
-    android:minHeight="@dimen/contact_browser_list_item_photo_size"
     android:gravity="left|center_vertical"
-    android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
     android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
index 7c82ea4..ff01a11 100644
--- a/res/layout/user_profile_header.xml
+++ b/res/layout/user_profile_header.xml
@@ -16,15 +16,19 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:paddingTop="@dimen/contact_browser_list_top_margin"
+    android:id="@+id/user_profile_header"
     android:orientation="vertical"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content" >
+    android:layout_height="wrap_content"
+    android:minHeight="?attr/list_item_header_height"
+    android:paddingTop="@dimen/contact_browser_list_top_margin"
+    android:paddingLeft="?attr/list_item_padding_left"
+    android:paddingRight="?attr/list_item_padding_right" >
 
     <LinearLayout
         android:orientation="horizontal"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content" >
+        android:layout_height="wrap_content">
 
         <TextView
             android:id="@+id/profile_title"
@@ -37,7 +41,7 @@
             android:gravity="left|center_vertical"
             android:layout_weight="1"
             android:textAppearance="?android:attr/textAppearanceSmall"
-            android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
+            android:paddingLeft="?attr/list_item_text_indent"
             android:textColor="@color/people_app_theme_color" />
 
         <TextView
@@ -55,6 +59,6 @@
     <View
         android:background="@color/people_app_theme_color"
         android:layout_width="match_parent"
-        android:layout_height="1dip" />
+        android:layout_height="?attr/list_item_header_underline_height" />
 
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/values-sw580dp-w720dp/styles.xml b/res/values-sw580dp-w720dp/styles.xml
index ff50d45..4314c80 100644
--- a/res/values-sw580dp-w720dp/styles.xml
+++ b/res/values-sw580dp-w720dp/styles.xml
@@ -37,10 +37,16 @@
         <item name="list_item_prefix_highlight_color">#729a27</item>
         <item name="list_item_header_text_indent">8dip</item>
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
-        <item name="list_item_header_height">26dip</item>
+        <item name="list_item_header_height">24dip</item>
         <item name="list_item_header_text_size">14sp</item>
         <item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+        <item name="list_item_header_underline_height">1dip</item>
+        <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+        <item name="list_item_contacts_count_text_size">12sp</item>
         <item name="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">0dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
+        <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
         <!-- Favorites -->
         <item name="favorites_padding_bottom">0dip</item>
     </style>
diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml
index 91842d6..af253f3 100644
--- a/res/values-sw580dp/dimens.xml
+++ b/res/values-sw580dp/dimens.xml
@@ -42,7 +42,5 @@
     <dimen name="contact_browser_list_top_margin">16dip</dimen>
     <dimen name="contact_browser_list_header_left_margin">@dimen/list_visible_scrollbar_padding</dimen>
     <dimen name="contact_browser_list_header_right_margin">24dip</dimen>
-    <dimen name="contact_browser_list_left_margin">0dip</dimen>
-    <dimen name="contact_browser_list_right_margin">0dip</dimen>
     <dimen name="list_visible_scrollbar_padding">48dip</dimen>
 </resources>
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index a386e57..efbbde2 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -19,7 +19,7 @@
         <item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</item>
         <item name="android:textColorPrimary">@color/primary_text_color</item>
         <item name="android:textColorSecondary">@color/secondary_text_color</item>
-        <item name="list_item_height">66dip</item>
+        <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
         <item name="activated_background">@drawable/list_item_activated_background</item>
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_item_divider">?android:attr/listDivider</item>
@@ -40,29 +40,51 @@
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
         <item name="list_item_header_height">26dip</item>
         <item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+        <item name="list_item_header_underline_height">1dip</item>
+        <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+        <item name="list_item_contacts_count_text_size">12sp</item>
         <item name="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">0dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
+        <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
         <!-- Favorites -->
         <item name="favorites_padding_bottom">0dip</item>
     </style>
 
     <style name="ContactPickerTheme" parent="@android:Theme.Holo.Light.Dialog">
-        <item name="list_item_height">66dip</item>
+        <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_item_divider">?android:attr/listDivider</item>
         <item name="list_item_padding_top">0dip</item>
-        <item name="list_item_padding_right">24dip</item>
+        <item name="list_item_padding_right">0dip</item>
         <item name="list_item_padding_bottom">0dip</item>
         <item name="list_item_padding_left">0dip</item>
-        <item name="list_item_gap_between_image_and_text">16dip</item>
+        <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
         <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
-        <item name="list_item_presence_icon_margin">30dip</item>
+        <item name="list_item_presence_icon_margin">18dip</item>
         <item name="list_item_photo_size">64dip</item>
         <item name="list_item_profile_photo_size">80dip</item>
-        <item name="list_item_header_text_indent">77dip</item>
-        <item name="list_item_header_text_color">?color/section_header_text_color</item>
+        <item name="list_item_header_text_indent">8dip</item>
         <item name="list_item_header_text_size">14sp</item>
+        <item name="list_item_header_text_color">@color/people_app_theme_color</item>
+        <item name="list_item_header_height">24dip</item>
+        <item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+        <item name="list_item_header_underline_height">1dip</item>
+        <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+        <item name="list_item_contacts_count_text_size">12sp</item>
+        <item name="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">16dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
+    </style>
+    <style name="ContactPickerLayout" parent="ContactPickerTheme">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">480dip</item>
+    </style>
+    <style name="JoinContactActivityTheme" parent="ContactPickerTheme" >
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">480dip</item>
     </style>
 
     <style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light.Dialog">
@@ -74,11 +96,6 @@
         <item name="android:layout_height">400dip</item>
     </style>
 
-    <style name="ContactPickerLayout" parent="ContactPickerTheme">
-        <item name="android:layout_width">480dip</item>
-        <item name="android:layout_height">match_parent</item>
-    </style>
-
     <style name="ContactDetailActivityTheme" parent="@android:Theme.Dialog">
         <item name="android:windowContentOverlay">@null</item>
     </style>
@@ -86,7 +103,7 @@
     <style name="DirectoryHeader" parent="PeopleTheme">
         <item name="android:paddingTop">0dip</item>
         <item name="android:paddingBottom">0dip</item>
-        <item name="android:background">@drawable/directory_bg_holo</item>
+        <item name="android:background">@android:color/transparent</item>
     </style>
 
     <style name="NonPhoneDialogTheme" parent="@android:Theme.Holo.Light.Dialog">
@@ -102,8 +119,4 @@
         <item name="android:windowNoDisplay">true</item>
         <item name="android:windowIsFloating">true</item>
     </style>
-
-    <style name="GroupBrowseListItem">
-        <item name="android:background">@drawable/list_item_activated_background</item>
-    </style>
 </resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 0f7b62d..7bec43a 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -68,6 +68,8 @@
 
     <declare-styleable name="ContactBrowser">
         <attr name="contact_filter_popup_width" format="dimension"/>
+        <attr name="contact_browser_list_padding_left" format="dimension"/>
+        <attr name="contact_browser_list_padding_right" format="dimension"/>
     </declare-styleable>
 
     <declare-styleable name="ContactListItemView">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a277124..1e47948 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -87,7 +87,6 @@
     <color name="dialtacts_secondary_text_color">#888888</color>
 
     <!-- Colors in the contact browser list -->
-    <color name="contact_browser_list_bk_color">#EEEEEE</color>
     <color name="contact_count_text_color">#AAAAAA</color>
 
     <!-- Color of the text of the tab carousel in the contact details  -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 69441fd..55fb5f3 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -210,8 +210,6 @@
     <!-- contact browser list margins -->
     <dimen name="contact_browser_list_header_left_margin">16dip</dimen>
     <dimen name="contact_browser_list_header_right_margin">@dimen/list_visible_scrollbar_padding</dimen>
-    <dimen name="contact_browser_list_left_margin">16dip</dimen>
-    <dimen name="contact_browser_list_right_margin">0dip</dimen>
     <dimen name="contact_browser_list_item_photo_size">64dip</dimen>
     <dimen name="contact_browser_list_item_text_indent">8dip</dimen>
 
diff --git a/res/values/styles.xml b/res/values/styles.xml
index d202a0f..84c3d15 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -42,9 +42,11 @@
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_size">12sp</item>
         <item name="list_item_header_height">24dip</item>
-        <item name="list_item_header_underline_height">1px</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="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">16dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
         <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
         <!-- CallLog -->
         <item name="call_log_primary_text_color">#FFFFFF</item>
@@ -144,17 +146,18 @@
         <item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
         <item name="list_item_profile_photo_size">70dip</item>
         <item name="list_item_prefix_highlight_color">#729a27</item>
-        <item name="list_item_header_text_indent">@dimen/contact_browser_list_item_text_indent</item>
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_size">14dip</item>
         <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_contacts_count_text_color">@color/contact_count_text_color</item>
+        <item name="list_item_header_text_indent">8dip</item>
         <item name="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">16dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
         <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
-        <item name="list_item_contacts_count_text_size">12dip</item>
-        list_item_contacts_count_text_size
+        <item name="list_item_contacts_count_text_size">12sp</item>
         <!-- Favorites -->
         <item name="favorites_padding_bottom">0dip</item>
     </style>
@@ -190,30 +193,19 @@
         <item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
         <item name="list_item_profile_photo_size">70dip</item>
         <item name="list_item_prefix_highlight_color">#729a27</item>
-        <item name="list_item_header_text_indent">56dip</item>
         <item name="list_item_header_text_color">?color/section_header_text_color</item>
         <item name="list_item_header_text_size">14sp</item>
+        <item name="list_item_header_text_indent">8dip</item>
         <item name="contact_filter_popup_width">320dip</item>
+        <item name="contact_browser_list_padding_left">16dip</item>
+        <item name="contact_browser_list_padding_right">0dip</item>
     </style>
 
-    <style name="ContactPickerTheme" parent="@android:Theme.Holo.Light">
-        <item name="section_header_background">@drawable/section_header</item>
-        <item name="list_item_divider">?android:attr/listDivider</item>
-        <item name="list_item_padding_top">4dip</item>
-        <item name="list_item_padding_right">11dip</item>
-        <item name="list_item_padding_bottom">4dip</item>
-        <item name="list_item_padding_left">4dip</item>
-        <item name="list_item_gap_between_image_and_text">8dip</item>
-        <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
-        <item name="list_item_vertical_divider_margin">5dip</item>
-        <item name="list_item_presence_icon_margin">5dip</item>
-        <item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
-        <item name="list_item_profile_photo_size">70dip</item>
-        <item name="list_item_prefix_highlight_color">#729a27</item>
-        <item name="list_item_header_text_indent">56dip</item>
-        <item name="list_item_header_text_color">?color/section_header_text_color</item>
-        <item name="list_item_header_text_size">14sp</item>
+    <style name="ContactPickerTheme" parent="@style/PeopleTheme">
+    </style>
+    <style name="ContactPickerLayout" parent="ContactPickerTheme">
+        <item name="android:layout_width">match_parent</item>
+        <item name="android:layout_height">match_parent</item>
     </style>
 
     <style name="JoinContactActivityTheme" parent="ContactPickerTheme" >
@@ -225,11 +217,6 @@
     <style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light">
     </style>
 
-    <style name="ContactPickerLayout" parent="ContactPickerTheme">
-        <item name="android:layout_width">match_parent</item>
-        <item name="android:layout_height">match_parent</item>
-    </style>
-
     <style name="CustomContactListFilterView" parent="ContactListFilterTheme">
         <item name="android:layout_width">match_parent</item>
         <item name="android:layout_height">match_parent</item>
@@ -247,7 +234,7 @@
 
     <style name="SectionDivider">
         <item name="android:background">#7e7e87</item>
-        <item name="android:layout_height">2dip</item>
+        <item name="android:layout_height">1dip</item>
         <item name="android:layout_width">match_parent</item>
     </style>
 
@@ -264,9 +251,6 @@
         <item name="android:layout_gravity">center_vertical</item>
     </style>
 
-    <style name="GroupBrowseListItem">
-    </style>
-
     <style name="DialtactsDigitsTextAppearance">
         <item name="android:maxLines">1</item>
         <item name="android:scrollHorizontally">true</item>