am dea958db: am 4202f18c: am 561e5974: am 7f11f2ec: Merge "Show phonetic name next to display name in UI." into mnc-dev
* commit 'dea958db4beac1de8efcdfd448ec172ada1828a9':
Show phonetic name next to display name in UI.
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index b8650e3..8b0a07e 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -19,7 +19,7 @@
<!-- Initial height of transparent space above QuickContacts -->
<dimen name="quickcontact_starting_empty_height">150dp</dimen>
<!-- Initial size of QuickContact's title size -->
- <dimen name="quickcontact_maximum_title_size">36dp</dimen>
+ <dimen name="quickcontact_maximum_title_size">30dp</dimen>
<!-- When QC is uncollapsed, the title has this much margin on its left, right and bottom -->
<dimen name="quickcontact_title_initial_margin">16dp</dimen>
<!-- The ratio of width:height for the contact's photo in landscape -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 936f093..bd9e341 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -767,4 +767,7 @@
<!-- Content description for the compact contact editor photo overlay which, when clicked, shows a dialog with the options for changing the contact photo. [CHAR LIMIT=30] -->
<string name="compact_editor_change_photo_content_description">Change photo</string>
+
+ <!-- Quick contact display name with phonetic name -->
+ <string name="quick_contact_display_name_with_phonetic"><xliff:g id="display_name">%s</xliff:g> (<xliff:g id="phonetic_name">%s</xliff:g>)</string>
</resources>
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 8b1c00a..a327d36 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -940,7 +940,16 @@
mPhotoView.setIsBusiness(mContactData.isDisplayNameFromOrganization());
mPhotoSetter.setupContactPhoto(data, mPhotoView);
extractAndApplyTintFromPhotoViewAsynchronously();
- setHeaderNameText(ContactDisplayUtils.getDisplayName(this, data).toString());
+ String phoneticName = ContactDisplayUtils.getPhoneticName(this, data);
+ String displayName = ContactDisplayUtils.getDisplayName(this, data).toString();
+ if (mContactData.getDisplayNameSource() != DisplayNameSources.STRUCTURED_PHONETIC_NAME
+ && !TextUtils.isEmpty(phoneticName)) {
+ displayName = getResources().getString(
+ R.string.quick_contact_display_name_with_phonetic, displayName, phoneticName);
+ setHeaderNameText(displayName);
+ } else {
+ setHeaderNameText(displayName);
+ }
Trace.endSection();