diff options
author | Brian Attwell <brianattwell@google.com> | 2014-11-04 19:04:42 -0800 |
---|---|---|
committer | Brian Attwell <brianattwell@google.com> | 2014-11-05 03:17:49 +0000 |
commit | 2ebade8924bb6d2734b603938f418959cc79e2ad (patch) | |
tree | a3cc58006f25dd89b77f992b8ceb277b5ed3459e /src | |
parent | 043fba637b421dcd554c634f769f0e883fb5ff8b (diff) | |
download | packages_apps_Contacts-2ebade8924bb6d2734b603938f418959cc79e2ad.tar.gz packages_apps_Contacts-2ebade8924bb6d2734b603938f418959cc79e2ad.tar.bz2 packages_apps_Contacts-2ebade8924bb6d2734b603938f418959cc79e2ad.zip |
Editor name fields
The mocks show all name fields collapsed into a single field.
After deeper inspection, this proved to be poor UX. Instead
we show the three name types inside a single name section.
Screenshot: go/ba_screen_captures/contacts/b18004959_edit_screen_material/name_fields.png
Bug: 18004959
Change-Id: Ic06abcd151a64746cce32832b27e8f47ec6b981d
Diffstat (limited to 'src')
3 files changed, 25 insertions, 2 deletions
diff --git a/src/com/android/contacts/editor/PhoneticNameEditorView.java b/src/com/android/contacts/editor/PhoneticNameEditorView.java index 420575cbd..e64568721 100644 --- a/src/com/android/contacts/editor/PhoneticNameEditorView.java +++ b/src/com/android/contacts/editor/PhoneticNameEditorView.java @@ -151,4 +151,12 @@ public class PhoneticNameEditorView extends TextFieldsEditorView { return !TextUtils.isEmpty(family) || !TextUtils.isEmpty(middle) || !TextUtils.isEmpty(given); } + + /** {@inheritDoc} */ + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + // Remove padding below this view. + setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), 0); + } } 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 diff --git a/src/com/android/contacts/editor/StructuredNameEditorView.java b/src/com/android/contacts/editor/StructuredNameEditorView.java index a607ccaaf..b24f7f149 100644 --- a/src/com/android/contacts/editor/StructuredNameEditorView.java +++ b/src/com/android/contacts/editor/StructuredNameEditorView.java @@ -275,4 +275,12 @@ public class StructuredNameEditorView extends TextFieldsEditorView { return 0; } } + + /** {@inheritDoc} */ + @Override + protected void onFinishInflate() { + super.onFinishInflate(); + // Remove padding below this view. + setPadding(getPaddingLeft(), getPaddingTop(), getPaddingRight(), 0); + } } |