Fixes for long phone numbers and labels.
Move the label after the numbe for consistency with other views.
Split the number and label so that RTL support works, instead of
composing two strings programmatically.
Do not split phone numbers and labels on multiple lines in the details
view.
Bug: 5465709
Bug: 5429886
Bug: 5631828
Change-Id: I169f99ae45a674f79c7bb3dc59f79801a8b38567
diff --git a/src/com/android/contacts/PhoneCallDetailsHelper.java b/src/com/android/contacts/PhoneCallDetailsHelper.java
index 2d75c26..60dfb7b 100644
--- a/src/com/android/contacts/PhoneCallDetailsHelper.java
+++ b/src/com/android/contacts/PhoneCallDetailsHelper.java
@@ -18,7 +18,6 @@
import com.android.contacts.calllog.CallTypeHelper;
import com.android.contacts.calllog.PhoneNumberHelper;
-import com.android.contacts.format.FormatUtils;
import android.content.res.Resources;
import android.graphics.Typeface;
@@ -103,6 +102,7 @@
final CharSequence nameText;
final CharSequence numberText;
+ final CharSequence labelText;
final CharSequence displayNumber =
mPhoneNumberHelper.getDisplayNumber(details.number, details.formattedNumber);
if (TextUtils.isEmpty(details.name)) {
@@ -113,20 +113,17 @@
} else {
numberText = details.geocode;
}
+ labelText = null;
} else {
nameText = details.name;
- if (numberFormattedLabel != null) {
- numberText = FormatUtils.applyStyleToSpan(Typeface.BOLD,
- numberFormattedLabel + " " + displayNumber, 0,
- numberFormattedLabel.length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
- } else {
- numberText = displayNumber;
- }
+ numberText = displayNumber;
+ labelText = numberFormattedLabel;
}
views.nameView.setText(nameText);
views.numberView.setText(numberText);
+ views.labelView.setText(labelText);
+ views.labelView.setVisibility(TextUtils.isEmpty(labelText) ? View.GONE : View.VISIBLE);
}
/** Sets the text of the header view for the details page of a phone call. */