Use EXACTLY instead of AT_MOST for width calculation
EXACTLY is much faster than AT_MOST and will make contacts listing
smoother
Bug: 5506837
Change-Id: I269175d9dea97baa86bcb1badc9e6294dcb7883b
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 5d549b8..d174c40 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -351,14 +351,14 @@
if (isVisible(mNameTextView)) {
mNameTextView.measure(
- MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mNameTextViewHeight = mNameTextView.getMeasuredHeight();
}
if (isVisible(mPhoneticNameTextView)) {
mPhoneticNameTextView.measure(
- MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mPhoneticNameTextViewHeight = mPhoneticNameTextView.getMeasuredHeight();
}
@@ -388,13 +388,13 @@
}
if (isVisible(mDataView)) {
- mDataView.measure(MeasureSpec.makeMeasureSpec(dataWidth, MeasureSpec.AT_MOST),
+ mDataView.measure(MeasureSpec.makeMeasureSpec(dataWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mDataViewHeight = mDataView.getMeasuredHeight();
}
if (isVisible(mLabelView)) {
- mLabelView.measure(MeasureSpec.makeMeasureSpec(labelWidth, MeasureSpec.AT_MOST),
+ mLabelView.measure(MeasureSpec.makeMeasureSpec(labelWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mLabelViewHeight = mLabelView.getMeasuredHeight();
}
@@ -402,7 +402,7 @@
if (isVisible(mSnippetView)) {
mSnippetView.measure(
- MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.AT_MOST),
+ MeasureSpec.makeMeasureSpec(effectiveWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
mSnippetTextViewHeight = mSnippetView.getMeasuredHeight();
}