Merge "Use ShapeDrawable for floating action button."
diff --git a/src/com/android/contacts/common/list/ContactEntryListAdapter.java b/src/com/android/contacts/common/list/ContactEntryListAdapter.java
index 92048b8..57b93b7 100644
--- a/src/com/android/contacts/common/list/ContactEntryListAdapter.java
+++ b/src/com/android/contacts/common/list/ContactEntryListAdapter.java
@@ -110,22 +110,6 @@
         ((ContactListPinnedHeaderView)pinnedHeaderView).setSectionHeader(title);
     }
 
-    @Override
-    protected void setPinnedHeaderContactsCount(View header) {
-        // Update the header with the contacts count only if a profile header exists
-        // otherwise, the contacts count are shown in the empty profile header view
-        if (mProfileExists) {
-            ((ContactListPinnedHeaderView)header).setCountView(mContactsCount);
-        } else {
-            clearPinnedHeaderContactsCount(header);
-        }
-    }
-
-    @Override
-    protected void clearPinnedHeaderContactsCount(View header) {
-        ((ContactListPinnedHeaderView)header).setCountView(null);
-    }
-
     protected void addPartitions() {
         addPartition(createDefaultDirectoryPartition());
     }
diff --git a/src/com/android/contacts/common/list/ContactListAdapter.java b/src/com/android/contacts/common/list/ContactListAdapter.java
index 2c40793..739b30e 100644
--- a/src/com/android/contacts/common/list/ContactListAdapter.java
+++ b/src/com/android/contacts/common/list/ContactListAdapter.java
@@ -210,17 +210,9 @@
             Cursor cursor) {
         if (isSectionHeaderDisplayEnabled()) {
             Placement placement = getItemPlacementInSection(position);
-
-            // First position, set the contacts number string
-            if (position == 0 && cursor.getInt(ContactQuery.CONTACT_IS_USER_PROFILE) == 1) {
-                view.setCountView(getContactsCount());
-            } else {
-                view.setCountView(null);
-            }
             view.setSectionHeader(placement.sectionHeader);
         } else {
             view.setSectionHeader(null);
-            view.setCountView(null);
         }
     }
 
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index d8427ae..84e74e5 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -91,8 +91,6 @@
     private int mHeaderTextSize = 12;
     private int mHeaderUnderlineHeight = 1;
     private int mHeaderUnderlineColor = 0;
-    private int mCountViewTextSize = 12;
-    private int mContactsCountTextColor = Color.BLACK;
     private int mTextIndent = 0;
     private Drawable mActivatedBackgroundDrawable;
 
@@ -140,10 +138,10 @@
         final int layoutDirection = TextUtils.getLayoutDirectionFromLocale(locale);
         switch (layoutDirection) {
             case View.LAYOUT_DIRECTION_RTL:
-                return (opposite ? PhotoPosition.RIGHT : PhotoPosition.LEFT);
+                return (opposite ? PhotoPosition.LEFT : PhotoPosition.RIGHT);
             case View.LAYOUT_DIRECTION_LTR:
             default:
-                return (opposite ? PhotoPosition.LEFT : PhotoPosition.RIGHT);
+                return (opposite ? PhotoPosition.RIGHT : PhotoPosition.LEFT);
         }
     }
 
@@ -165,7 +163,6 @@
     private TextView mDataView;
     private TextView mSnippetView;
     private TextView mStatusView;
-    private TextView mCountView;
     private ImageView mPresenceIcon;
 
     private ColorStateList mSecondaryTextColor;
@@ -275,12 +272,6 @@
                 mHeaderUnderlineColor);
         mTextIndent = a.getDimensionPixelOffset(
                 R.styleable.ContactListItemView_list_item_text_indent, mTextIndent);
-        mCountViewTextSize = a.getDimensionPixelSize(
-                R.styleable.ContactListItemView_list_item_contacts_count_text_size,
-                mCountViewTextSize);
-        mContactsCountTextColor = a.getColor(
-                R.styleable.ContactListItemView_list_item_contacts_count_text_color,
-                mContactsCountTextColor);
         mDataViewWidthWeight = a.getInteger(
                 R.styleable.ContactListItemView_list_item_data_width_weight, mDataViewWidthWeight);
         mLabelViewWidthWeight = a.getInteger(
@@ -459,11 +450,6 @@
             mHeaderTextView.measure(
                     MeasureSpec.makeMeasureSpec(headerWidth, MeasureSpec.EXACTLY),
                     MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
-            if (mCountView != null) {
-                mCountView.measure(
-                        MeasureSpec.makeMeasureSpec(headerWidth, MeasureSpec.AT_MOST),
-                        MeasureSpec.makeMeasureSpec(mHeaderBackgroundHeight, MeasureSpec.EXACTLY));
-            }
             mHeaderBackgroundHeight = Math.max(mHeaderBackgroundHeight,
                     mHeaderTextView.getMeasuredHeight());
             height += (mHeaderBackgroundHeight + mHeaderUnderlineHeight);
@@ -491,12 +477,6 @@
                     0,
                     isLayoutRtl ? rightBound - mHeaderTextIndent : rightBound,
                     mHeaderBackgroundHeight);
-            if (mCountView != null) {
-                mCountView.layout(rightBound - mCountView.getMeasuredWidth(),
-                        0,
-                        rightBound,
-                        mHeaderBackgroundHeight);
-            }
             mHeaderDivider.layout(leftBound,
                     mHeaderBackgroundHeight,
                     rightBound,
@@ -947,7 +927,6 @@
             mLabelView.setEllipsize(getTextEllipsis());
             mLabelView.setTextAppearance(getContext(), R.style.TextAppearanceSmall);
             if (mPhotoPosition == PhotoPosition.LEFT) {
-                //mLabelView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mCountViewTextSize);
                 mLabelView.setAllCaps(true);
                 mLabelView.setGravity(Gravity.END);
             } else {
@@ -1094,39 +1073,6 @@
     }
 
     /**
-     * Returns the text view for the contacts count, creating it if necessary.
-     */
-    public TextView getCountView() {
-        if (mCountView == null) {
-            mCountView = new TextView(getContext());
-            mCountView.setSingleLine(true);
-            mCountView.setEllipsize(getTextEllipsis());
-            mCountView.setTextAppearance(getContext(), android.R.style.TextAppearance_Medium);
-            mCountView.setTextColor(R.color.people_app_theme_color);
-            addView(mCountView);
-        }
-        return mCountView;
-    }
-
-    /**
-     * Adds or updates a text view for the contacts count.
-     */
-    public void setCountView(CharSequence text) {
-        if (TextUtils.isEmpty(text)) {
-            if (mCountView != null) {
-                mCountView.setVisibility(View.GONE);
-            }
-        } else {
-            getCountView();
-            setMarqueeText(mCountView, text);
-            mCountView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mCountViewTextSize);
-            mCountView.setGravity(Gravity.CENTER_VERTICAL);
-            mCountView.setTextColor(mContactsCountTextColor);
-            mCountView.setVisibility(VISIBLE);
-        }
-    }
-
-    /**
      * Adds or updates a text view for the status.
      */
     public void setStatus(CharSequence text) {
diff --git a/src/com/android/contacts/common/list/ContactListPinnedHeaderView.java b/src/com/android/contacts/common/list/ContactListPinnedHeaderView.java
index 401b3e3..83892b4 100644
--- a/src/com/android/contacts/common/list/ContactListPinnedHeaderView.java
+++ b/src/com/android/contacts/common/list/ContactListPinnedHeaderView.java
@@ -45,8 +45,6 @@
     private final int mHeaderUnderlineColor;
     private final int mPaddingRight;
     private final int mPaddingLeft;
-    private final int mContactsCountTextColor;
-    private final int mCountViewTextSize;
 
     private int mHeaderBackgroundHeight;
     private TextView mHeaderTextView;
@@ -75,10 +73,6 @@
                 R.styleable.ContactListItemView_list_item_padding_left, 0);
         mPaddingRight = a.getDimensionPixelOffset(
                 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();
 
@@ -121,22 +115,13 @@
         final int topTextView = 0;
         final int bottomTextView = mHeaderBackgroundHeight;
 
-        int leftCountTextView = 0;
-        int rightCountTextView = 0;
 
         if (ViewUtil.isViewLayoutRtl(this)) {
             rightHeaderTextView = width - mPaddingRight - mHeaderTextIndent;
             leftHeaderTextView = rightHeaderTextView - mHeaderTextView.getMeasuredWidth();
-
-            leftCountTextView = mHeaderTextIndent + mPaddingLeft;
-            rightCountTextView = mCountTextView.getMeasuredWidth() + leftCountTextView;
         } else {
             leftHeaderTextView = mHeaderTextIndent + mPaddingLeft;
             rightHeaderTextView = mHeaderTextView.getMeasuredWidth() + leftHeaderTextView;
-
-            // Order of statements matters
-            rightCountTextView = width - mPaddingRight;
-            leftCountTextView = rightCountTextView - mCountTextView.getMeasuredWidth();
         }
 
         // Take into account left and right padding when laying out the below views.
@@ -145,13 +130,6 @@
                 rightHeaderTextView,
                 bottomTextView);
 
-        if (isViewMeasurable(mCountTextView)) {
-            mCountTextView.layout(leftCountTextView,
-                    topTextView,
-                    rightCountTextView,
-                    bottomTextView);
-        }
-
         mHeaderDivider.layout(mPaddingLeft,
                 mHeaderBackgroundHeight,
                 width - mPaddingRight,
@@ -180,22 +158,6 @@
         forceLayout();
     }
 
-    public void setCountView(String count) {
-        if (mCountTextView == null) {
-            mCountTextView = new TextView(mContext);
-            mCountTextView.setTextColor(mContactsCountTextColor);
-            mCountTextView.setTextSize(TypedValue.COMPLEX_UNIT_PX, mCountViewTextSize);
-            mCountTextView.setGravity(Gravity.CENTER_VERTICAL);
-            addView(mCountTextView);
-        }
-        mCountTextView.setText(count);
-        if (count == null || count.isEmpty()) {
-            mCountTextView.setVisibility(View.GONE);
-        } else {
-            mCountTextView.setVisibility(View.VISIBLE);
-        }
-    }
-
     private boolean isViewMeasurable(View view) {
         return (view != null && view.getVisibility() == View.VISIBLE);
     }
diff --git a/src/com/android/contacts/common/list/IndexerListAdapter.java b/src/com/android/contacts/common/list/IndexerListAdapter.java
index 14243ce..60d7f3c 100644
--- a/src/com/android/contacts/common/list/IndexerListAdapter.java
+++ b/src/com/android/contacts/common/list/IndexerListAdapter.java
@@ -70,16 +70,6 @@
      */
     protected abstract void setPinnedSectionTitle(View pinnedHeaderView, String title);
 
-    /**
-     * Sets the contacts count in the pinned header.
-     */
-    protected abstract void setPinnedHeaderContactsCount(View header);
-
-    /**
-     * clears the contacts count in the pinned header and makes the view invisible.
-     */
-    protected abstract void clearPinnedHeaderContactsCount(View header);
-
     public boolean isSectionHeaderDisplayEnabled() {
         return mSectionHeaderDisplayEnabled;
     }
@@ -185,11 +175,7 @@
                 listView.setHeaderInvisible(index, false);
             } else {
                 setPinnedSectionTitle(mHeader, (String)mIndexer.getSections()[section]);
-                if (section == 0) {
-                    setPinnedHeaderContactsCount(mHeader);
-                } else {
-                    clearPinnedHeaderContactsCount(mHeader);
-                }
+
                 // Compute the item position where the current partition begins
                 int partitionStart = getPositionForPartition(mIndexedPartition);
                 if (hasHeader(mIndexedPartition)) {