Search in sources :

Example 26 with DataKind

use of com.android.contacts.common.model.dataitem.DataKind in project android_packages_apps_Dialer by LineageOS.

the class BaseAccountType method addDataKindNickname.

protected DataKind addDataKindNickname(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(Nickname.CONTENT_ITEM_TYPE, R.string.nicknameLabelsGroup, Weight.NICKNAME, true));
    kind.typeOverallMax = 1;
    kind.actionHeader = new SimpleInflater(R.string.nicknameLabelsGroup);
    kind.actionBody = new SimpleInflater(Nickname.NAME);
    kind.defaultValues = new ContentValues();
    kind.defaultValues.put(Nickname.TYPE, Nickname.TYPE_DEFAULT);
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Nickname.NAME, R.string.nicknameLabelsGroup, FLAGS_PERSON_NAME));
    return kind;
}
Also used : ContentValues(android.content.ContentValues) DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 27 with DataKind

use of com.android.contacts.common.model.dataitem.DataKind in project android_packages_apps_Dialer by LineageOS.

the class BaseAccountType method addDataKindPhoneticName.

protected DataKind addDataKindPhoneticName(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_PHONETIC_NAME, R.string.name_phonetic, Weight.NONE, true));
    kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
    kind.actionBody = new SimpleInflater(Nickname.NAME);
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(DataKind.PSEUDO_COLUMN_PHONETIC_NAME, R.string.name_phonetic, FLAGS_PHONETIC).setShortForm(true));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME, R.string.name_phonetic_family, FLAGS_PHONETIC).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME, R.string.name_phonetic_middle, FLAGS_PHONETIC).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME, R.string.name_phonetic_given, FLAGS_PHONETIC).setLongForm(true));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 28 with DataKind

use of com.android.contacts.common.model.dataitem.DataKind in project android_packages_apps_Dialer by LineageOS.

the class BaseAccountType method addDataKindStructuredName.

protected DataKind addDataKindStructuredName(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(StructuredName.CONTENT_ITEM_TYPE, R.string.nameLabelsGroup, Weight.NONE, true));
    kind.actionHeader = new SimpleInflater(R.string.nameLabelsGroup);
    kind.actionBody = new SimpleInflater(Nickname.NAME);
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(StructuredName.DISPLAY_NAME, R.string.full_name, FLAGS_PERSON_NAME));
    kind.fieldList.add(new EditField(StructuredName.PREFIX, R.string.name_prefix, FLAGS_PERSON_NAME).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.FAMILY_NAME, R.string.name_family, FLAGS_PERSON_NAME).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.MIDDLE_NAME, R.string.name_middle, FLAGS_PERSON_NAME).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.GIVEN_NAME, R.string.name_given, FLAGS_PERSON_NAME).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.SUFFIX, R.string.name_suffix, FLAGS_PERSON_NAME).setLongForm(true));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_FAMILY_NAME, R.string.name_phonetic_family, FLAGS_PHONETIC));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_MIDDLE_NAME, R.string.name_phonetic_middle, FLAGS_PHONETIC));
    kind.fieldList.add(new EditField(StructuredName.PHONETIC_GIVEN_NAME, R.string.name_phonetic_given, FLAGS_PHONETIC));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 29 with DataKind

use of com.android.contacts.common.model.dataitem.DataKind in project android_packages_apps_Dialer by LineageOS.

the class BaseAccountType method addDataKindGroupMembership.

protected DataKind addDataKindGroupMembership(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(GroupMembership.CONTENT_ITEM_TYPE, R.string.groupsLabel, Weight.GROUP_MEMBERSHIP, true));
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(GroupMembership.GROUP_ROW_ID, -1, -1));
    kind.maxLinesForDisplay = MAX_LINES_FOR_GROUP;
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 30 with DataKind

use of com.android.contacts.common.model.dataitem.DataKind in project android_packages_apps_Dialer by LineageOS.

the class BaseAccountType method addDataKindPhoto.

protected DataKind addDataKindPhoto(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(Photo.CONTENT_ITEM_TYPE, -1, Weight.NONE, true));
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Photo.PHOTO, -1, -1));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Aggregations

DataKind (com.android.contacts.common.model.dataitem.DataKind)50 ContentValues (android.content.ContentValues)8 ValuesDelta (com.android.contacts.common.model.ValuesDelta)5 RawContactDelta (com.android.contacts.common.model.RawContactDelta)3 AccountType (com.android.contacts.common.model.account.AccountType)3 Calendar (java.util.Calendar)3 Intent (android.content.Intent)2 Resources (android.content.res.Resources)2 Drawable (android.graphics.drawable.Drawable)2 SpannableString (android.text.SpannableString)2 EmailDataItem (com.android.contacts.common.model.dataitem.EmailDataItem)2 EventDataItem (com.android.contacts.common.model.dataitem.EventDataItem)2 GroupMembershipDataItem (com.android.contacts.common.model.dataitem.GroupMembershipDataItem)2 ImDataItem (com.android.contacts.common.model.dataitem.ImDataItem)2 NicknameDataItem (com.android.contacts.common.model.dataitem.NicknameDataItem)2 NoteDataItem (com.android.contacts.common.model.dataitem.NoteDataItem)2 OrganizationDataItem (com.android.contacts.common.model.dataitem.OrganizationDataItem)2 PhoneDataItem (com.android.contacts.common.model.dataitem.PhoneDataItem)2 RelationDataItem (com.android.contacts.common.model.dataitem.RelationDataItem)2 SipAddressDataItem (com.android.contacts.common.model.dataitem.SipAddressDataItem)2