Delete contacts list item dividers.
- Delete setDivider method, and associated layout logic.
- Delete unneeded list_item_divider attribute.
Bug: 13956531
Change-Id: I56d471ae637346cb6a1b9a56c6c43de2da603256
diff --git a/src/com/android/contacts/common/list/ContactListAdapter.java b/src/com/android/contacts/common/list/ContactListAdapter.java
index 0750459..2c40793 100644
--- a/src/com/android/contacts/common/list/ContactListAdapter.java
+++ b/src/com/android/contacts/common/list/ContactListAdapter.java
@@ -218,10 +218,8 @@
view.setCountView(null);
}
view.setSectionHeader(placement.sectionHeader);
- view.setDividerVisible(!placement.lastInSection);
} else {
view.setSectionHeader(null);
- view.setDividerVisible(true);
view.setCountView(null);
}
}
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java
index b6aa800..d8427ae 100644
--- a/src/com/android/contacts/common/list/ContactListItemView.java
+++ b/src/com/android/contacts/common/list/ContactListItemView.java
@@ -109,11 +109,6 @@
private int mSelectionBoundsMarginLeft;
private int mSelectionBoundsMarginRight;
- // Horizontal divider between contact views.
- private boolean mHorizontalDividerVisible = true;
- private Drawable mHorizontalDividerDrawable;
- private int mHorizontalDividerHeight;
-
protected static class HighlightSequence {
private final int start;
private final int end;
@@ -250,8 +245,6 @@
R.styleable.ContactListItemView_list_item_height, mPreferredHeight);
mActivatedBackgroundDrawable = a.getDrawable(
R.styleable.ContactListItemView_activated_background);
- mHorizontalDividerDrawable = a.getDrawable(
- R.styleable.ContactListItemView_list_item_divider);
mGapBetweenImageAndText = a.getDimensionPixelOffset(
R.styleable.ContactListItemView_list_item_gap_between_image_and_text,
@@ -312,8 +305,6 @@
mSecondaryTextColor = a.getColorStateList(R.styleable.Theme_android_textColorSecondary);
a.recycle();
- mHorizontalDividerHeight = mHorizontalDividerDrawable.getIntrinsicHeight();
-
if (mActivatedBackgroundDrawable != null) {
mActivatedBackgroundDrawable.setCallback(this);
}
@@ -335,12 +326,7 @@
// We will match parent's width and wrap content vertically, but make sure
// height is no less than listPreferredItemHeight.
final int specWidth = resolveSize(0, widthMeasureSpec);
- final int preferredHeight;
- if (mHorizontalDividerVisible) {
- preferredHeight = mPreferredHeight + mHorizontalDividerHeight;
- } else {
- preferredHeight = mPreferredHeight;
- }
+ final int preferredHeight = mPreferredHeight;
mNameTextViewHeight = 0;
mPhoneticNameTextViewHeight = 0;
@@ -463,11 +449,6 @@
// Make sure the height is at least as high as the photo
height = Math.max(height, mPhotoViewHeight + getPaddingBottom() + getPaddingTop());
- // Add horizontal divider height
- if (mHorizontalDividerVisible) {
- height += mHorizontalDividerHeight;
- }
-
// Make sure height is at least the preferred height
height = Math.max(height, preferredHeight);
@@ -523,16 +504,6 @@
topBound += (mHeaderBackgroundHeight + mHeaderUnderlineHeight);
}
- // Put horizontal divider at the bottom
- if (mHorizontalDividerVisible) {
- mHorizontalDividerDrawable.setBounds(
- leftBound,
- height - mHorizontalDividerHeight,
- rightBound,
- height);
- bottomBound -= mHorizontalDividerHeight;
- }
-
mBoundsWithoutHeader.set(0, topBound, width, bottomBound);
if (mActivatedStateSupported && isActivated()) {
@@ -758,22 +729,11 @@
if (mActivatedStateSupported && isActivated()) {
mActivatedBackgroundDrawable.draw(canvas);
}
- if (mHorizontalDividerVisible) {
- mHorizontalDividerDrawable.draw(canvas);
- }
super.dispatchDraw(canvas);
}
/**
- * Sets the flag that determines whether a divider should drawn at the bottom
- * of the view.
- */
- public void setDividerVisible(boolean visible) {
- mHorizontalDividerVisible = visible;
- }
-
- /**
* Sets section header or makes it invisible if the title is null.
*/
public void setSectionHeader(String title) {
diff --git a/src/com/android/contacts/common/list/PhoneNumberListAdapter.java b/src/com/android/contacts/common/list/PhoneNumberListAdapter.java
index a6d67ce..953c409 100644
--- a/src/com/android/contacts/common/list/PhoneNumberListAdapter.java
+++ b/src/com/android/contacts/common/list/PhoneNumberListAdapter.java
@@ -363,7 +363,6 @@
final DirectoryPartition directory = (DirectoryPartition) getPartition(partition);
bindPhoneNumber(view, cursor, directory.isDisplayNumber());
- view.setDividerVisible(showBottomDivider);
}
protected void bindPhoneNumber(ContactListItemView view, Cursor cursor, boolean displayNumber) {
@@ -396,10 +395,8 @@
if (isSectionHeaderDisplayEnabled()) {
Placement placement = getItemPlacementInSection(position);
view.setSectionHeader(placement.firstInSection ? placement.sectionHeader : null);
- view.setDividerVisible(!placement.lastInSection);
} else {
view.setSectionHeader(null);
- view.setDividerVisible(true);
}
}