diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
deleted file mode 100644
index 6a7c3b4..0000000
--- a/res/layout/user_profile_button.xml
+++ /dev/null
@@ -1,33 +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.
--->
-
-<Button
-    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:layout_marginStart="?attr/list_item_padding_left"
-    android:layout_marginEnd="?attr/list_item_padding_right"
-    android:paddingLeft="?attr/list_item_header_text_indent"
-    android:paddingStart="?attr/list_item_header_text_indent"
-    android:background="?android:attr/selectableItemBackground"
-    android:singleLine="true"
-    android:text="@string/profile_display_name"
-    android:ellipsize="end"
-    android:gravity="start|center_vertical"
-    android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
index 1d08298..5a07313 100644
--- a/res/layout/user_profile_header.xml
+++ b/res/layout/user_profile_header.xml
@@ -25,31 +25,32 @@
     android:paddingStart="?attr/list_item_padding_left"
     android:paddingEnd="?attr/list_item_padding_right"
     android:paddingTop="4dp"
-    android:paddingBottom="8dp"
-    android:background="@drawable/list_section_divider_holo_custom"
-    android:gravity="center_vertical"
-    >
+    android:paddingBottom="8dp" >
 
-    <TextView
-        android:id="@+id/profile_title"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+    <TextView android:id="@+id/profile_title"
+        android:layout_width="@dimen/contact_list_section_header_width"
+        android:layout_height="?android:attr/listPreferredItemHeight"
         android:singleLine="true"
         android:text="@string/user_profile_contacts_list_header"
         android:ellipsize="end"
-        android:layout_weight="1"
-        android:textAppearance="@style/DirectoryHeaderStyle"
-        android:paddingLeft="?attr/list_item_text_indent"
-        android:paddingStart="?attr/list_item_text_indent" />
+        android:textAppearance="@style/SectionHeaderStyle"
+        android:gravity="start|center_vertical" />
 
-    <TextView
-        android:id="@+id/contacts_count"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
+    <Button android:id="@+id/user_profile_button"
+        xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="?android:attr/listPreferredItemHeight"
+        android:layout_marginLeft="?attr/list_item_padding_left"
+        android:layout_marginRight="?attr/list_item_padding_right"
+        android:layout_marginStart="?attr/list_item_padding_left"
+        android:layout_marginEnd="?attr/list_item_padding_right"
+        android:paddingLeft="?attr/list_item_gap_between_image_and_text"
+        android:paddingStart="?attr/list_item_gap_between_image_and_text"
+        android:background="?android:attr/selectableItemBackground"
         android:singleLine="true"
+        android:text="@string/profile_display_name"
         android:ellipsize="end"
-        android:textAppearance="?android:attr/textAppearanceSmall"
-        android:textSize="12sp"
-        android:textColor="@color/people_app_theme_color" />
+        android:gravity="start|center_vertical"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
 
 </LinearLayout>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d88d688..5cad5f2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -258,12 +258,6 @@
     <!-- Displayed at the top of the contacts showing the zero as total number of contacts visible when "Only contacts with phones" is selected [CHAR LIMIT=64]-->
     <string name="listTotalPhoneContactsZero">No contacts with phone numbers</string>
 
-    <!-- Displayed at the top of the contacts showing the total number of contacts visible when "Only contacts with phones" not selected -->
-    <plurals name="listTotalAllContacts">
-        <item quantity="one">1 contact</item>
-        <item quantity="other"><xliff:g id="count">%d</xliff:g> contacts</item>
-    </plurals>
-
     <!-- Displayed at the top of the contacts showing the total number of contacts found when "Only contacts with phones" not selected [CHAR LIMIT=30] -->
     <plurals name="listFoundAllContacts">
         <item quantity="one">1 found</item>
diff --git a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
index 90495fa..b16b76e 100644
--- a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
@@ -19,9 +19,11 @@
 import android.content.CursorLoader;
 import android.content.Intent;
 import android.database.Cursor;
+import android.graphics.Color;
 import android.provider.ContactsContract.Contacts;
 import android.text.TextUtils;
 import android.util.Log;
+import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -39,6 +41,7 @@
 import com.android.contacts.common.list.ContactListItemView;
 import com.android.contacts.common.list.DefaultContactListAdapter;
 import com.android.contacts.common.list.ProfileAndContactsLoader;
+import com.android.contacts.common.util.ViewUtil;
 import com.android.contacts.editor.ContactEditorFragment;
 import com.android.contacts.common.util.AccountFilterUtil;
 
@@ -51,13 +54,11 @@
 
     private static final int REQUEST_CODE_ACCOUNT_FILTER = 1;
 
-    private TextView mCounterHeaderView;
     private View mSearchHeaderView;
     private View mAccountFilterHeader;
     private FrameLayout mProfileHeaderContainer;
     private View mProfileHeader;
     private Button mProfileMessage;
-    private FrameLayout mMessageContainer;
     private TextView mProfileTitle;
     private View mSearchProgress;
     private TextView mSearchProgressText;
@@ -113,7 +114,6 @@
 
         mAccountFilterHeader = getView().findViewById(R.id.account_filter_header_container);
         mAccountFilterHeader.setOnClickListener(mFilterHeaderClickListener);
-        mCounterHeaderView = (TextView) getView().findViewById(R.id.contacts_count);
 
         // Create an empty user profile header and hide it for now (it will be visible if the
         // contacts list will have no user profile).
@@ -145,12 +145,9 @@
     }
 
     private void checkHeaderViewVisibility() {
-        if (mCounterHeaderView != null) {
-            mCounterHeaderView.setVisibility(isSearchMode() ? View.GONE : View.VISIBLE);
-        }
         updateFilterHeaderView();
 
-        // Hide the search header by default. See showCount().
+        // Hide the search header by default.
         if (mSearchHeaderView != null) {
             mSearchHeaderView.setVisibility(View.GONE);
         }
@@ -177,43 +174,11 @@
     }
 
     @Override
-    protected void showCount(int partitionIndex, Cursor data) {
-        if (!isSearchMode() && data != null) {
-            int count = data.getCount();
-            if (count != 0) {
-                count -= (mUserProfileExists ? 1: 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));
-                } else {
-                    mCounterHeaderView.setText(String.format(format, count));
-                }
-            } else {
-                ContactListFilter filter = getFilter();
-                int filterType = filter != null ? filter.filterType
-                        : ContactListFilter.FILTER_TYPE_ALL_ACCOUNTS;
-                switch (filterType) {
-                    case ContactListFilter.FILTER_TYPE_ACCOUNT:
-                        mCounterHeaderView.setText(getString(
-                                R.string.listTotalAllContactsZeroGroup, filter.accountName));
-                        break;
-                    case ContactListFilter.FILTER_TYPE_WITH_PHONE_NUMBERS_ONLY:
-                        mCounterHeaderView.setText(R.string.listTotalPhoneContactsZero);
-                        break;
-                    case ContactListFilter.FILTER_TYPE_STARRED:
-                        mCounterHeaderView.setText(R.string.listTotalAllContactsZeroStarred);
-                        break;
-                    case ContactListFilter.FILTER_TYPE_CUSTOM:
-                        mCounterHeaderView.setText(R.string.listTotalAllContactsZeroCustom);
-                        break;
-                    default:
-                        mCounterHeaderView.setText(R.string.listTotalAllContactsZero);
-                        break;
-                }
-            }
-        } else {
+    protected void setProfileHeader() {
+        mUserProfileExists = getAdapter().hasProfile();
+        showEmptyUserProfile(!mUserProfileExists && !isSearchMode());
+
+        if (isSearchMode()) {
             ContactListAdapter adapter = getAdapter();
             if (adapter == null) {
                 return;
@@ -240,12 +205,6 @@
     }
 
     @Override
-    protected void setProfileHeader() {
-        mUserProfileExists = getAdapter().hasProfile();
-        showEmptyUserProfile(!mUserProfileExists && !isSearchMode());
-    }
-
-    @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == REQUEST_CODE_ACCOUNT_FILTER) {
             if (getActivity() != null) {
@@ -263,9 +222,7 @@
         // and mProfileTitle
         mProfileHeaderContainer.setVisibility(show ? View.VISIBLE : View.GONE);
         mProfileHeader.setVisibility(show ? View.VISIBLE : View.GONE);
-        mCounterHeaderView.setVisibility(show ? View.VISIBLE : View.GONE);
         mProfileTitle.setVisibility(show ? View.VISIBLE : View.GONE);
-        mMessageContainer.setVisibility(show ? View.VISIBLE : View.GONE);
         mProfileMessage.setVisibility(show ? View.VISIBLE : View.GONE);
     }
 
@@ -276,24 +233,17 @@
      * 2. A button that prompts the user to create a local profile
      */
     private void addEmptyUserProfileHeader(LayoutInflater inflater) {
-
         ListView list = getListView();
-        // Put a header with the "ME" name and a view for the number of contacts
-        // The view is embedded in a frame view since you cannot change the visibility of a
-        // view in a ListView without having a parent view.
-        mProfileHeaderContainer = new FrameLayout(inflater.getContext());
+        // Add a header with the "ME" name. The view is embedded in a frame view since you cannot
+        // change the visibility of a view in a ListView without having a parent view.
         mProfileHeader = inflater.inflate(R.layout.user_profile_header, null, false);
-        mCounterHeaderView = (TextView) mProfileHeader.findViewById(R.id.contacts_count);
         mProfileTitle = (TextView) mProfileHeader.findViewById(R.id.profile_title);
+        mProfileHeaderContainer = new FrameLayout(inflater.getContext());
         mProfileHeaderContainer.addView(mProfileHeader);
         list.addHeaderView(mProfileHeaderContainer, null, false);
 
-        // Add a selectable view with a message inviting the user to create a local profile
-        mMessageContainer = new FrameLayout(inflater.getContext());
-        mProfileMessage = (Button)inflater.inflate(R.layout.user_profile_button, null, false);
-        mMessageContainer.addView(mProfileMessage);
-        list.addHeaderView(mMessageContainer, null, true);
-
+        // Add a button with a message inviting the user to create a local profile
+        mProfileMessage = (Button) mProfileHeader.findViewById(R.id.user_profile_button);
         mProfileMessage.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
