summaryrefslogtreecommitdiffstats
path: root/src/com/android/contacts/editor/RawContactEditorView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/contacts/editor/RawContactEditorView.java')
-rw-r--r--src/com/android/contacts/editor/RawContactEditorView.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/contacts/editor/RawContactEditorView.java b/src/com/android/contacts/editor/RawContactEditorView.java
index f0fbc4abe..4a05d7abb 100644
--- a/src/com/android/contacts/editor/RawContactEditorView.java
+++ b/src/com/android/contacts/editor/RawContactEditorView.java
@@ -64,6 +64,7 @@ public class RawContactEditorView extends BaseRawContactEditorView {
private StructuredNameEditorView mName;
private PhoneticNameEditorView mPhoneticName;
+ private KindSectionView mNickNameSectionView;
private GroupMembershipView mGroupMembershipView;
private ViewGroup mFields;
@@ -127,6 +128,8 @@ public class RawContactEditorView extends BaseRawContactEditorView {
mPhoneticName = (PhoneticNameEditorView)findViewById(R.id.edit_phonetic_name);
mPhoneticName.setDeletable(false);
+ mNickNameSectionView = (KindSectionView)findViewById(R.id.edit_nick_name);
+
mFields = (ViewGroup)findViewById(R.id.sect_fields);
mAccountIcon = (ImageView) findViewById(R.id.account_icon);
@@ -243,6 +246,11 @@ public class RawContactEditorView extends BaseRawContactEditorView {
mPhoneticName.setValues(
type.getKindForMimetype(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME),
primary, state, false, vig);
+ // Special case for nick name, so it gets inserted in the header section. It
+ // should look like it belongs to the same KindSectionView as the other name fields.
+ mNickNameSectionView.setEnabled(isEnabled());
+ mNickNameSectionView.setState(type.getKindForMimetype(Nickname.CONTENT_ITEM_TYPE),
+ state, false, vig);
} else if (Photo.CONTENT_ITEM_TYPE.equals(mimeType)) {
// Handle special case editor for photos
final ValuesDelta primary = state.getPrimaryEntry(mimeType);
@@ -255,8 +263,7 @@ public class RawContactEditorView extends BaseRawContactEditorView {
} else if (DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME.equals(mimeType)
|| DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME.equals(mimeType)
|| Nickname.CONTENT_ITEM_TYPE.equals(mimeType)) {
- // Don't create fields for each of these mime-types. Instead, a single merged
- // field is created for these mime-types.
+ // Don't create fields for each of these mime-types. They are handled specially.
continue;
} else {
// Otherwise use generic section-based editors