Search in sources :

Example 6 with DataKind

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

the class BaseAccountType method addDataKindEmail.

protected DataKind addDataKindEmail(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(Email.CONTENT_ITEM_TYPE, R.string.emailLabelsGroup, Weight.EMAIL, true));
    kind.actionHeader = new EmailActionInflater();
    kind.actionBody = new SimpleInflater(Email.DATA);
    kind.typeColumn = Email.TYPE;
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildEmailType(Email.TYPE_HOME));
    kind.typeList.add(buildEmailType(Email.TYPE_WORK));
    kind.typeList.add(buildEmailType(Email.TYPE_OTHER));
    kind.typeList.add(buildEmailType(Email.TYPE_MOBILE));
    kind.typeList.add(buildEmailType(Email.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Email.LABEL));
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Email.DATA, R.string.emailLabelsGroup, FLAGS_EMAIL));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 7 with DataKind

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

the class BaseAccountType method addDataKindSipAddress.

protected DataKind addDataKindSipAddress(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(SipAddress.CONTENT_ITEM_TYPE, R.string.label_sip_address, Weight.SIP_ADDRESS, true));
    kind.actionHeader = new SimpleInflater(R.string.label_sip_address);
    kind.actionBody = new SimpleInflater(SipAddress.SIP_ADDRESS);
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(SipAddress.SIP_ADDRESS, R.string.label_sip_address, FLAGS_SIP_ADDRESS));
    kind.typeOverallMax = 1;
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 8 with DataKind

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

the class BaseAccountType method addDataKindPhone.

protected DataKind addDataKindPhone(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(Phone.CONTENT_ITEM_TYPE, R.string.phoneLabelsGroup, Weight.PHONE, true));
    kind.iconAltRes = R.drawable.quantum_ic_message_vd_theme_24;
    kind.iconAltDescriptionRes = R.string.sms;
    kind.actionHeader = new PhoneActionInflater();
    kind.actionAltHeader = new PhoneActionAltInflater();
    kind.actionBody = new SimpleInflater(Phone.NUMBER);
    kind.typeColumn = Phone.TYPE;
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE));
    kind.typeList.add(buildPhoneType(Phone.TYPE_HOME));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_WORK).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_HOME).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_PAGER).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CUSTOM).setSecondary(true).setCustomColumn(Phone.LABEL));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CALLBACK).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CAR).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_COMPANY_MAIN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_ISDN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MAIN).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_OTHER_FAX).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_RADIO).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_TELEX).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_TTY_TDD).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_MOBILE).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK_PAGER).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_ASSISTANT).setSecondary(true));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MMS).setSecondary(true));
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Phone.NUMBER, R.string.phoneLabelsGroup, FLAGS_PHONE));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 9 with DataKind

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

the class ExchangeAccountType method addDataKindPhoto.

@Override
protected DataKind addDataKindPhoto(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindPhoto(context);
    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)

Example 10 with DataKind

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

the class ExchangeAccountType method addDataKindPhoneticName.

@Override
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(StructuredName.PHONETIC_FAMILY_NAME, R.string.name_phonetic_family, 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)

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