diff options
author | Stephen Bird <sbird@cyngn.com> | 2016-02-09 16:33:23 -0800 |
---|---|---|
committer | Richard MacGregor <rmacgregor@cyngn.com> | 2016-03-25 11:42:19 -0700 |
commit | 916ed1bc84f63efd9ed6c3a3166bc013dfe65f9d (patch) | |
tree | 127d15022b89e67adc4e31c3fe10519ac1a07a82 /src/com/android/contacts/common/list/ContactListItemView.java | |
parent | 77f642f704c98ef3c41f9f35146c20bd5d347639 (diff) | |
download | android_packages_apps_ContactsCommon-916ed1bc84f63efd9ed6c3a3166bc013dfe65f9d.tar.gz android_packages_apps_ContactsCommon-916ed1bc84f63efd9ed6c3a3166bc013dfe65f9d.tar.bz2 android_packages_apps_ContactsCommon-916ed1bc84f63efd9ed6c3a3166bc013dfe65f9d.zip |
(2/2) T9 cleanup
We can remove the changes we made to ContactListItemView
since we are now using the adapter to auto-merge multiple
mimetype items. This fixes ripples and let's us clean up
quite a bit on the app side of things
Ticket: CD-370 CD-339 CD-359 CD-385 CD-384 CD-380 CD-378 CD-372
Change-Id: I929957720cb836bfbe9bf5be187ce8d7df8a1b1c
Diffstat (limited to 'src/com/android/contacts/common/list/ContactListItemView.java')
-rw-r--r-- | src/com/android/contacts/common/list/ContactListItemView.java | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/src/com/android/contacts/common/list/ContactListItemView.java b/src/com/android/contacts/common/list/ContactListItemView.java index d8c42ad5..7916e636 100644 --- a/src/com/android/contacts/common/list/ContactListItemView.java +++ b/src/com/android/contacts/common/list/ContactListItemView.java @@ -163,7 +163,6 @@ public class ContactListItemView extends ViewGroup private TextView mPhoneticNameTextView; private TextView mLabelView; private TextView mDataView; - private TextView mCallProviderView; private TextView mSnippetView; private TextView mStatusView; private ImageView mPresenceIcon; @@ -206,8 +205,6 @@ public class ContactListItemView extends ViewGroup private int mPhoneticNameTextViewHeight; private int mLabelViewHeight; private int mDataViewHeight; - private int mCallProviderViewHeight; - private int mCallProviderBottomPadding; private int mSnippetTextViewHeight; private int mStatusTextViewHeight; private int mCheckBoxHeight; @@ -340,8 +337,6 @@ public class ContactListItemView extends ViewGroup mStatusTextViewHeight = 0; mCheckBoxWidth = 0; mCheckBoxHeight = 0; - mCallProviderViewHeight = 0; - mCallProviderBottomPadding = 0; ensurePhotoViewSize(); @@ -420,17 +415,6 @@ public class ContactListItemView extends ViewGroup mDataViewHeight = mDataView.getMeasuredHeight(); } - if (isVisible(mCallProviderView)) { - mCallProviderView.measure(MeasureSpec.makeMeasureSpec(dataWidth, MeasureSpec.EXACTLY), - MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); - - // Multiply our height by two + gap - // Why? cause padding below and above the text + text height - mCallProviderViewHeight = mCallProviderView.getMeasuredHeight(); - mCallProviderBottomPadding = getContext().getResources() - .getDimensionPixelSize(R.dimen.call_provider_bottom_padding); - } - if (isVisible(mLabelView)) { // For performance reason we don't want AT_MOST usually, but when the picture is // on right, we need to use it anyway because mDataView is next to mLabelView. @@ -482,11 +466,6 @@ public class ContactListItemView extends ViewGroup // Make sure height is at least the preferred height height = Math.max(height, preferredHeight); - if (isVisible(mCallProviderView)) { - // add callproviderviewheight; - height += mCallProviderViewHeight + mCallProviderBottomPadding; - } - // Measure the header if it is visible. if (mHeaderTextView != null && mHeaderTextView.getVisibility() == VISIBLE) { mHeaderTextView.measure( @@ -564,8 +543,7 @@ public class ContactListItemView extends ViewGroup // Photo is the left most view. All the other Views should on the right of the photo. if (photoView != null) { // Center the photo vertically - int photoTop = (topBound + (bottomBound - topBound - mPhotoViewHeight - - mCallProviderViewHeight - mCallProviderBottomPadding) / 2); + int photoTop = (topBound + (bottomBound - topBound - mPhotoViewHeight) / 2); photoView.layout( leftBound, photoTop, @@ -598,8 +576,7 @@ public class ContactListItemView extends ViewGroup // Center text vertically, then apply the top offset. final int totalTextHeight = mNameTextViewHeight + mPhoneticNameTextViewHeight + - mLabelAndDataViewMaxHeight + mSnippetTextViewHeight + mStatusTextViewHeight - + mCallProviderViewHeight + mCallProviderBottomPadding; + mLabelAndDataViewMaxHeight + mSnippetTextViewHeight + mStatusTextViewHeight; int textTopBound = (bottomBound + topBound - totalTextHeight) / 2 + mTextOffsetTop; // Layout all text view and presence icon @@ -705,13 +682,6 @@ public class ContactListItemView extends ViewGroup textTopBound += mLabelAndDataViewMaxHeight; } - if (isVisible(mCallProviderView)) { - mCallProviderView.layout(dataLeftBound, - textTopBound + mCallProviderBottomPadding, - rightBound, - textTopBound + mCallProviderViewHeight + mCallProviderBottomPadding); - } - if (isVisible(mSnippetView)) { mSnippetView.layout(leftBound, textTopBound, @@ -1078,27 +1048,6 @@ public class ContactListItemView extends ViewGroup } } - /** - * Sets phone number for a list item. - */ - public void setExtraNumber(String text) { - if (TextUtils.isEmpty(text)) { - if (mCallProviderView != null) { - mCallProviderView.setVisibility(View.GONE); - } - } else { - getCallProviderView(); - - final SpannableString textToSet = new SpannableString(text); - setMarqueeText(mCallProviderView, textToSet); - mCallProviderView.setVisibility(VISIBLE); - - // We have a phone number as "mDataView" so make it always LTR and VIEW_START - mCallProviderView.setTextDirection(View.TEXT_DIRECTION_LTR); - mCallProviderView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START); - } - } - private void setMarqueeText(TextView textView, char[] text, int size) { if (getTextEllipsis() == TruncateAt.MARQUEE) { setMarqueeText(textView, new String(text, 0, size)); @@ -1152,24 +1101,6 @@ public class ContactListItemView extends ViewGroup } /** - * Returns the text view for the data text, creating it if necessary. - */ - public TextView getCallProviderView() { - if (mCallProviderView == null) { - mCallProviderView = new TextView(getContext()); - mCallProviderView.setSingleLine(true); - mCallProviderView.setEllipsize(getTextEllipsis()); - mCallProviderView.setTextAppearance(getContext(), R.style.TextAppearanceSmall); - mCallProviderView.setTextAlignment(View.TEXT_ALIGNMENT_VIEW_START); - mCallProviderView.setActivated(isActivated()); - mCallProviderView.setId(R.id.cliv_data_view); - mCallProviderView.setElegantTextHeight(false); - addView(mCallProviderView); - } - return mCallProviderView; - } - - /** * Adds or updates a text view for the search snippet. */ public void setSnippet(String text) { |