Search in sources :

Example 36 with DataKind

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

the class ExchangeAccountType method addDataKindPhone.

@Override
protected DataKind addDataKindPhone(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindPhone(context);
    kind.typeColumn = Phone.TYPE;
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildPhoneType(Phone.TYPE_MOBILE).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_HOME).setSpecificMax(2));
    kind.typeList.add(buildPhoneType(Phone.TYPE_WORK).setSpecificMax(2));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_WORK).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_FAX_HOME).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_PAGER).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_CAR).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_COMPANY_MAIN).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_MMS).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_RADIO).setSecondary(true).setSpecificMax(1));
    kind.typeList.add(buildPhoneType(Phone.TYPE_ASSISTANT).setSecondary(true).setSpecificMax(1));
    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 37 with DataKind

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

the class ExchangeAccountType method addDataKindNote.

@Override
protected DataKind addDataKindNote(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindNote(context);
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Note.NOTE, R.string.label_notes, FLAGS_NOTE));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 38 with DataKind

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

the class ExchangeAccountType method addDataKindDisplayName.

@Override
protected DataKind addDataKindDisplayName(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(DataKind.PSEUDO_MIME_TYPE_DISPLAY_NAME, R.string.nameLabelsGroup, Weight.NONE, true));
    boolean displayOrderPrimary = context.getResources().getBoolean(R.bool.config_editor_field_order_primary);
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(StructuredName.PREFIX, R.string.name_prefix, FLAGS_PERSON_NAME).setOptional(true));
    if (!displayOrderPrimary) {
        kind.fieldList.add(new EditField(StructuredName.FAMILY_NAME, R.string.name_family, FLAGS_PERSON_NAME));
        kind.fieldList.add(new EditField(StructuredName.MIDDLE_NAME, R.string.name_middle, FLAGS_PERSON_NAME).setOptional(true));
        kind.fieldList.add(new EditField(StructuredName.GIVEN_NAME, R.string.name_given, FLAGS_PERSON_NAME));
    } else {
        kind.fieldList.add(new EditField(StructuredName.GIVEN_NAME, R.string.name_given, FLAGS_PERSON_NAME));
        kind.fieldList.add(new EditField(StructuredName.MIDDLE_NAME, R.string.name_middle, FLAGS_PERSON_NAME).setOptional(true));
        kind.fieldList.add(new EditField(StructuredName.FAMILY_NAME, R.string.name_family, FLAGS_PERSON_NAME));
    }
    kind.fieldList.add(new EditField(StructuredName.SUFFIX, R.string.name_suffix, FLAGS_PERSON_NAME).setOptional(true));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 39 with DataKind

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

the class ExchangeAccountType method addDataKindEvent.

protected DataKind addDataKindEvent(Context context) throws DefinitionException {
    DataKind kind = addKind(new DataKind(Event.CONTENT_ITEM_TYPE, R.string.eventLabelsGroup, Weight.EVENT, true));
    kind.actionHeader = new EventActionInflater();
    kind.actionBody = new SimpleInflater(Event.START_DATE);
    kind.typeOverallMax = 1;
    kind.typeColumn = Event.TYPE;
    kind.typeList = new ArrayList<>();
    kind.typeList.add(buildEventType(Event.TYPE_BIRTHDAY, false).setSpecificMax(1));
    kind.dateFormatWithYear = CommonDateUtils.DATE_AND_TIME_FORMAT;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Event.DATA, R.string.eventLabelsGroup, FLAGS_EVENT));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 40 with DataKind

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

the class ExchangeAccountType method addDataKindWebsite.

@Override
protected DataKind addDataKindWebsite(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindWebsite(context);
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Website.URL, R.string.websiteLabelsGroup, FLAGS_WEBSITE));
    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