Merge "Fix bug 5051541 Group members list flashes when syncing"
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index 567e63d..f98d751 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -41,14 +41,17 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:minHeight="@dimen/contact_filter_header_min_height"
-            android:layout_marginLeft="8dip"
             android:singleLine="true"
             android:ellipsize="end"
-            android:gravity="left"
+            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"
             android:textColor="?android:attr/textColorSecondary" />
         <View
             android:id="@+id/account_filter_header_bottom_divider"
+            android:layout_height="1dip"
             style="@style/SectionDivider" />
     </LinearLayout>
 
diff --git a/res/layout/dialpad.xml b/res/layout/dialpad.xml
index e9a95ee..1f74c26 100644
--- a/res/layout/dialpad.xml
+++ b/res/layout/dialpad.xml
@@ -19,13 +19,18 @@
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/dialpad"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
+    android:layout_height="0px"
+    android:layout_weight="0.650"
     android:layout_gravity="center_horizontal"
-    android:layout_marginTop="4dip"
-    android:background="@drawable/dialpad_background"
-    android:layout_weight="1">
+    android:layout_marginTop="@dimen/dialpad_vertical_margin"
+    android:paddingLeft="5dip"
+    android:paddingRight="5dip"
+    android:paddingBottom="10dip"
+    android:background="@drawable/dialpad_background">
 
-    <TableRow>
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
         <ImageButton android:id="@+id/one" style="@style/DialtactsDialpadButtonStyle"
             android:src="@drawable/dial_num_1"
             android:contentDescription="@string/description_image_button_one" />
@@ -37,7 +42,9 @@
             android:contentDescription="@string/description_image_button_three" />
     </TableRow>
 
-    <TableRow>
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
         <ImageButton android:id="@+id/four" style="@style/DialtactsDialpadButtonStyle"
             android:src="@drawable/dial_num_4"
             android:contentDescription="@string/description_image_button_four" />
@@ -49,7 +56,9 @@
             android:contentDescription="@string/description_image_button_six" />
     </TableRow>
 
-    <TableRow>
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
         <ImageButton android:id="@+id/seven" style="@style/DialtactsDialpadButtonStyle"
             android:src="@drawable/dial_num_7"
             android:contentDescription="@string/description_image_button_seven" />
@@ -61,7 +70,9 @@
             android:contentDescription="@string/description_image_button_nine" />
     </TableRow>
 
-    <TableRow>
+    <TableRow
+         android:layout_height="0px"
+         android:layout_weight="1">
         <ImageButton android:id="@+id/star" style="@style/DialtactsDialpadButtonStyle"
             android:src="@drawable/dial_num_star"
             android:contentDescription="@string/description_image_button_star" />
@@ -71,6 +82,5 @@
         <ImageButton android:id="@+id/pound" style="@style/DialtactsDialpadButtonStyle"
             android:src="@drawable/dial_num_pound"
             android:contentDescription="@string/description_image_button_pound" />
-
     </TableRow>
 </TableLayout>
diff --git a/res/layout/dialpad_additional_buttons.xml b/res/layout/dialpad_additional_buttons.xml
index 47a578e..a5e247b 100644
--- a/res/layout/dialpad_additional_buttons.xml
+++ b/res/layout/dialpad_additional_buttons.xml
@@ -18,11 +18,10 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/dialpadAdditionalButtons"
     android:layout_width="match_parent"
-    android:layout_height="@dimen/dialpad_additional_buttons_height"
+    android:layout_height="0px"
+    android:layout_weight="0.150"
     android:layout_gravity="center_horizontal"
-    android:layout_marginTop="4dip"
-    android:layout_marginBottom="4dip"
-    android:layout_weight="0.25"
+    android:layout_marginTop="@dimen/dialpad_vertical_margin"
     android:background="@drawable/dialpad_background"
     android:orientation="horizontal">
 
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml
index 864dcc7..90d2593 100644
--- a/res/layout/dialpad_fragment.xml
+++ b/res/layout/dialpad_fragment.xml
@@ -19,15 +19,16 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical"
-    android:paddingLeft="4dip"
-    android:paddingRight="4dip">
+    android:paddingLeft="@dimen/dialpad_horizontal_margin"
+    android:paddingRight="@dimen/dialpad_horizontal_margin">
 
     <!-- Text field and possibly soft menu button above the keypad where
          the digits are displayed. -->
     <RelativeLayout
         android:layout_width="match_parent"
-        android:layout_height="@dimen/dialpad_digits_height"
-        android:layout_marginTop="4dip"
+        android:layout_height="0px"
+        android:layout_weight="0.200"
+        android:layout_marginTop="@dimen/dialpad_vertical_margin"
         android:gravity="center" >
 
         <!-- Type of this EditText is set to NULL (to disable the IME keyboard)
@@ -45,10 +46,11 @@
             android:textColor="?android:attr/textColorPrimary" />
 
         <ImageButton android:id="@+id/overflow_menu"
-            android:layout_width="wrap_content"
+            android:layout_width="48dip"
             android:layout_height="match_parent"
             android:layout_alignParentRight="true"
-            android:src="@drawable/ic_menu_overflow" />
+            android:src="@drawable/ic_menu_overflow"
+            android:background="@android:color/transparent"/>
 
     </RelativeLayout>
 
diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
index b7b5e1d..4937d7b 100644
--- a/res/layout/user_profile_button.xml
+++ b/res/layout/user_profile_button.xml
@@ -19,9 +19,10 @@
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:background="?android:attr/selectableItemBackground"
-    android:paddingLeft="@dimen/contact_browser_list_left_margin"
     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 ae803ba..7c82ea4 100644
--- a/res/layout/user_profile_header.xml
+++ b/res/layout/user_profile_header.xml
@@ -16,7 +16,7 @@
 
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:background="@color/contact_browser_list_bk_color"
+    android:paddingTop="@dimen/contact_browser_list_top_margin"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="wrap_content" >
@@ -30,14 +30,14 @@
             android:id="@+id/profile_title"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
             android:singleLine="true"
             android:text="@string/user_profile_contacts_list_header"
             android:textStyle="bold"
             android:ellipsize="end"
-            android:gravity="left"
+            android:gravity="left|center_vertical"
             android:layout_weight="1"
-            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
             android:textColor="@color/people_app_theme_color" />
 
         <TextView
@@ -46,15 +46,15 @@
             android:layout_height="wrap_content"
             android:singleLine="true"
             android:ellipsize="end"
-            android:layout_gravity="right"
-            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:layout_gravity="right|center_vertical"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textSize="12dip"
             android:textColor="@color/contact_count_text_color" />
     </LinearLayout>
 
     <View
         android:background="@color/people_app_theme_color"
-        android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
         android:layout_width="match_parent"
-        android:layout_height="1px" />
+        android:layout_height="1dip" />
 
 </LinearLayout>
\ No newline at end of file
diff --git a/res/values-long/dimens.xml b/res/values-long/dimens.xml
deleted file mode 100644
index af51d4c..0000000
--- a/res/values-long/dimens.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?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.
--->
-<resources>
-    <dimen name="dialpad_digits_height">80dip</dimen>
-    <dimen name="dialpad_additional_buttons_height">58dip</dimen>
-    <dimen name="dialpad_button_height">70dip</dimen>
-</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 4d4050e..0f7b62d 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -96,6 +96,8 @@
         <attr name="list_item_header_underline_height" format="dimension" />
         <attr name="list_item_header_underline_color" format="color" />
         <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" />
     </declare-styleable>
 
     <declare-styleable name="CallLog">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 6e6cadb..a277124 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -88,7 +88,7 @@
 
     <!-- Colors in the contact browser list -->
     <color name="contact_browser_list_bk_color">#EEEEEE</color>
-    <color name="contact_count_text_color">#777777</color>
+    <color name="contact_count_text_color">#AAAAAA</color>
 
     <!-- Color of the text of the tab carousel in the contact details  -->
     <color name="detail_tab_carousel_tab_label_color">#EEEEEE</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 1edc590..69441fd 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -194,14 +194,15 @@
     <dimen name="group_editor_member_list_height">550dip</dimen>
 
     <!-- Height of edit text in dialpad fragment -->
-    <dimen name="dialpad_digits_height">67dip</dimen>
-    <dimen name="dialpad_digits_text_size">33sp</dimen>
-    <dimen name="dialpad_additional_buttons_height">50dip</dimen>
-    <dimen name="dialpad_button_height">50dip</dimen>
+    <dimen name="dialpad_horizontal_margin">4dip</dimen>
+    <dimen name="dialpad_vertical_margin">2dip</dimen>
+    <dimen name="dialpad_digits_text_size">35sp</dimen>
+
     <!-- Just used in landscape mode -->
-    <dimen name="dialpad_digits_margin_top">1dip</dimen>
-    <!-- Just used in landscape mode -->
-    <dimen name="dialpad_digits_margin_bottom">50dip</dimen>
+    <dimen name="dialpad_button_height">0px</dimen>
+    <dimen name="dialpad_digits_height">0px</dimen>
+    <dimen name="dialpad_digits_margin_top">0px</dimen>
+    <dimen name="dialpad_digits_margin_bottom">0px</dimen>
 
     <!-- Width of search view in action bar.  Use 0dip for MATCH_PARENT -->
     <dimen name="search_view_width">0dip</dimen>
@@ -211,8 +212,10 @@
     <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>
 
-    <dimen name="contact_browser_list_top_margin">0dip</dimen>
+    <dimen name="contact_browser_list_top_margin">8dip</dimen>
     <dimen name="contacts_count_right_margin">40dip</dimen>
 
     <!--  ContactTile Layouts -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 763a600..e6cad61 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -24,7 +24,7 @@
         <item name="activated_background">@drawable/list_item_activated_background</item>
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_section_header_height">32dip</item>
-        <item name="list_item_divider">@drawable/list_item_divider</item>
+        <item name="list_item_divider">?android:attr/listDivider</item>
         <item name="list_item_padding_top">0dip</item>
         <item name="list_item_padding_right">0dip</item>
         <item name="list_item_padding_bottom">0dip</item>
@@ -35,16 +35,17 @@
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_presence_icon_size">16dip</item>
-        <item name="list_item_photo_size">56dip</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">4dip</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_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_color">@color/people_app_theme_color</item>
         <item name="contact_filter_popup_width">320dip</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>
         <item name="call_log_primary_background_color">#000000</item>
@@ -129,7 +130,7 @@
         <item name="activated_background">@drawable/list_item_activated_background</item>
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_section_header_height">24dip</item>
-        <item name="list_item_divider">@drawable/list_item_divider</item>
+        <item name="list_item_divider">?android:attr/listDivider</item>
         <item name="list_item_padding_top">0dip</item>
         <item name="list_item_padding_right">0dip</item>
         <item name="list_item_padding_bottom">0dip</item>
@@ -140,17 +141,20 @@
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_presence_icon_size">16dip</item>
-        <item name="list_item_photo_size">56dip</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">4dip</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">12sp</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">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="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
         <item name="contact_filter_popup_width">320dip</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
         <!-- Favorites -->
         <item name="favorites_padding_bottom">0dip</item>
     </style>
@@ -173,7 +177,7 @@
         <item name="activated_background">@drawable/list_item_activated_background</item>
         <item name="section_header_background">@drawable/list_title_holo</item>
         <item name="list_section_header_height">32dip</item>
-        <item name="list_item_divider">@drawable/list_item_divider</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>
@@ -183,7 +187,7 @@
         <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">56dip</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>
@@ -194,7 +198,7 @@
 
     <style name="ContactPickerTheme" parent="@android:Theme.Holo.Light">
         <item name="section_header_background">@drawable/section_header</item>
-        <item name="list_item_divider">@drawable/list_item_divider</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>
@@ -204,7 +208,7 @@
         <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">56dip</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>
@@ -276,7 +280,7 @@
 
     <style name="DialtactsDialpadButtonStyle">
         <item name="android:layout_width">0dip</item>
-        <item name="android:layout_height">@dimen/dialpad_button_height</item>
+        <item name="android:layout_height">match_parent</item>
         <item name="android:layout_weight">1</item>
         <item name="android:background">@drawable/btn_dial</item>
         <item name="android:soundEffectsEnabled">false</item>
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 0fe8d0d..7ddece6 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -36,6 +36,7 @@
 import android.text.TextUtils;
 import android.text.TextUtils.TruncateAt;
 import android.util.AttributeSet;
+import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
@@ -85,6 +86,9 @@
     private final int mHeaderTextSize;
     private final int mHeaderUnderlineHeight;
     private final int mHeaderUnderlineColor;
+    private final int mCountViewTextSize;
+    private final int mContactsCountTextColor;
+    private final int mTextIndent;
 
     private Drawable mActivatedBackgroundDrawable;
 
@@ -226,7 +230,7 @@
                 R.styleable.ContactListItemView_list_item_header_text_indent, 0);
         mHeaderTextColor = a.getColor(
                 R.styleable.ContactListItemView_list_item_header_text_color, Color.BLACK);
-        mHeaderTextSize = a.getDimensionPixelSize(
+        mHeaderTextSize = (int)a.getDimensionPixelSize(
                 R.styleable.ContactListItemView_list_item_header_text_size, 12);
         mHeaderBackgroundHeight = a.getDimensionPixelSize(
                 R.styleable.ContactListItemView_list_item_header_height, 30);
@@ -234,6 +238,12 @@
                 R.styleable.ContactListItemView_list_item_header_underline_height, 1);
         mHeaderUnderlineColor = a.getColor(
                 R.styleable.ContactListItemView_list_item_header_underline_color, 0);
+        mTextIndent = a.getDimensionPixelOffset(
+                R.styleable.ContactListItemView_list_item_text_indent, 0);
+        mCountViewTextSize = (int)a.getDimensionPixelSize(
+                R.styleable.ContactListItemView_list_item_contacts_count_text_size, 12);
+        mContactsCountTextColor = a.getColor(
+                R.styleable.ContactListItemView_list_item_contacts_count_text_color, Color.BLACK);
 
         mPrefixHighligher = new PrefixHighlighter(
                 a.getColor(R.styleable.ContactListItemView_list_item_prefix_highlight_color,
@@ -424,7 +434,7 @@
         // Layout all text view and presence icon
         // Put name TextView first
         if (isVisible(mNameTextView)) {
-            mNameTextView.layout(leftBound,
+            mNameTextView.layout(leftBound + mTextIndent,
                     textTopBound,
                     rightBound,
                     textTopBound + mNameTextViewHeight);
@@ -432,13 +442,13 @@
         }
 
         // Presence and status
-        int statusLeftBound = leftBound;
+        int statusLeftBound = leftBound + mTextIndent;
         if (isVisible(mPresenceIcon)) {
             int iconWidth = mPresenceIcon.getMeasuredWidth();
             mPresenceIcon.layout(
-                    leftBound,
+                    leftBound + mTextIndent,
                     textTopBound,
-                    leftBound + iconWidth,
+                    leftBound + iconWidth + mTextIndent,
                     textTopBound + mStatusTextViewHeight);
             statusLeftBound += (iconWidth + mPresenceIconMargin);
         }
@@ -457,7 +467,7 @@
         // Rest of text views
         int dataLeftBound = leftBound;
         if (isVisible(mPhoneticNameTextView)) {
-            mPhoneticNameTextView.layout(leftBound,
+            mPhoneticNameTextView.layout(leftBound + mTextIndent,
                     textTopBound,
                     rightBound,
                     textTopBound + mPhoneticNameTextViewHeight);
@@ -465,8 +475,8 @@
         }
 
         if (isVisible(mLabelView)) {
-            dataLeftBound = leftBound + mLabelView.getMeasuredWidth();
-            mLabelView.layout(leftBound,
+            dataLeftBound = leftBound + mLabelView.getMeasuredWidth() + mTextIndent;
+            mLabelView.layout(leftBound + mTextIndent,
                     textTopBound,
                     dataLeftBound,
                     textTopBound + mLabelTextViewHeight);
@@ -484,7 +494,7 @@
         }
 
         if (isVisible(mSnippetView)) {
-            mSnippetView.layout(leftBound,
+            mSnippetView.layout(leftBound + mTextIndent,
                     textTopBound,
                     rightBound,
                     textTopBound + mSnippetTextViewHeight);
@@ -645,7 +655,7 @@
             if (mHeaderTextView == null) {
                 mHeaderTextView = new TextView(mContext);
                 mHeaderTextView.setTextColor(mHeaderTextColor);
-                mHeaderTextView.setTextSize(mHeaderTextSize);
+                mHeaderTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mHeaderTextSize);
                 mHeaderTextView.setTypeface(mHeaderTextView.getTypeface(), Typeface.BOLD);
                 mHeaderTextView.setGravity(Gravity.CENTER_VERTICAL);
                 addView(mHeaderTextView);
@@ -958,6 +968,9 @@
         } else {
             getCountView();
             mCountView.setText(text);
+            mCountView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mCountViewTextSize);
+            mCountView.setGravity(Gravity.CENTER_VERTICAL);
+            mCountView.setTextColor(mContactsCountTextColor);
             mCountView.setVisibility(VISIBLE);
         }
     }
diff --git a/src/com/android/contacts/list/ContactListPinnedHeaderView.java b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
index a689045..5983007 100644
--- a/src/com/android/contacts/list/ContactListPinnedHeaderView.java
+++ b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
@@ -26,6 +26,7 @@
 import android.graphics.drawable.Drawable;
 import android.text.TextUtils;
 import android.util.AttributeSet;
+import android.util.TypedValue;
 import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
@@ -46,6 +47,7 @@
     private final int mPaddingRight;
     private final int mPaddingLeft;
     private final int mContactsCountTextColor;
+    private final int mCountViewTextSize;
 
     private int mHeaderBackgroundHeight;
     private TextView mHeaderTextView;
@@ -76,12 +78,14 @@
                 R.styleable.ContactListItemView_list_item_padding_right, 0);
         mContactsCountTextColor = a.getColor(
                 R.styleable.ContactListItemView_list_item_contacts_count_text_color, Color.BLACK);
+        mCountViewTextSize = (int)a.getDimensionPixelSize(
+                R.styleable.ContactListItemView_list_item_contacts_count_text_size, 12);
 
         a.recycle();
 
         mHeaderTextView = new TextView(mContext);
         mHeaderTextView.setTextColor(mHeaderTextColor);
-        mHeaderTextView.setTextSize(mHeaderTextSize);
+        mHeaderTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mHeaderTextSize);
         mHeaderTextView.setTypeface(mHeaderTextView.getTypeface(), Typeface.BOLD);
         mHeaderTextView.setGravity(Gravity.CENTER_VERTICAL);
         addView(mHeaderTextView);
@@ -156,7 +160,8 @@
         if (mCountTextView == null) {
             mCountTextView = new TextView(mContext);
             mCountTextView.setTextColor(mContactsCountTextColor);
-            mCountTextView.setTextSize(mHeaderTextSize);
+            mCountTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mCountViewTextSize);
+            mCountTextView.setGravity(Gravity.CENTER_VERTICAL);
             addView(mCountTextView);
         }
         mCountTextView.setText(count);
diff --git a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
index 8590c29..4db2270 100644
--- a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
@@ -139,8 +139,9 @@
             if (count != 0) {
                 String format = getResources().getQuantityText(
                         R.plurals.listTotalAllContacts, count).toString();
+                // Do not count the user profile in the contacts count
                 if (mUserProfileExists) {
-                    getAdapter().setContactsCount(String.format(format, count));
+                    getAdapter().setContactsCount(String.format(format, count - 1));
                 } else {
                     mCounterHeaderView.setText(String.format(format, count));
                 }