Search in sources :

Example 11 with DataKind

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

the class ExchangeAccountType method addDataKindIm.

@Override
protected DataKind addDataKindIm(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindIm(context);
    // Types are not supported for IM. There can be 3 IMs, but OWA only shows only the first
    kind.typeOverallMax = 3;
    kind.defaultValues = new ContentValues();
    kind.defaultValues.put(Im.TYPE, Im.TYPE_OTHER);
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Im.DATA, R.string.imLabelsGroup, FLAGS_EMAIL));
    return kind;
}
Also used : ContentValues(android.content.ContentValues) DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 12 with DataKind

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

the class ExchangeAccountType method addDataKindOrganization.

@Override
protected DataKind addDataKindOrganization(Context context) throws DefinitionException {
    final DataKind kind = super.addDataKindOrganization(context);
    kind.typeOverallMax = 1;
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Organization.COMPANY, R.string.ghostData_company, FLAGS_GENERIC_NAME));
    kind.fieldList.add(new EditField(Organization.TITLE, R.string.ghostData_title, FLAGS_GENERIC_NAME));
    return kind;
}
Also used : DataKind(com.android.contacts.common.model.dataitem.DataKind)

Example 13 with DataKind

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

the class ExchangeAccountType method addDataKindStructuredName.

@Override
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.PREFIX, R.string.name_prefix, 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.MIDDLE_NAME, R.string.name_middle, FLAGS_PERSON_NAME));
    kind.fieldList.add(new EditField(StructuredName.GIVEN_NAME, R.string.name_given, FLAGS_PERSON_NAME));
    kind.fieldList.add(new EditField(StructuredName.SUFFIX, R.string.name_suffix, FLAGS_PERSON_NAME));
    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)

Example 14 with DataKind

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

the class ExchangeAccountType method addDataKindEmail.

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

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

the class GoogleAccountType method addDataKindEvent.

private 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.typeColumn = Event.TYPE;
    kind.typeList = new ArrayList<>();
    kind.dateFormatWithoutYear = CommonDateUtils.NO_YEAR_DATE_FORMAT;
    kind.dateFormatWithYear = CommonDateUtils.FULL_DATE_FORMAT;
    kind.typeList.add(buildEventType(Event.TYPE_BIRTHDAY, true).setSpecificMax(1));
    kind.typeList.add(buildEventType(Event.TYPE_ANNIVERSARY, false));
    kind.typeList.add(buildEventType(Event.TYPE_OTHER, false));
    kind.typeList.add(buildEventType(Event.TYPE_CUSTOM, false).setSecondary(true).setCustomColumn(Event.LABEL));
    kind.defaultValues = new ContentValues();
    kind.defaultValues.put(Event.TYPE, Event.TYPE_BIRTHDAY);
    kind.fieldList = new ArrayList<>();
    kind.fieldList.add(new EditField(Event.DATA, R.string.eventLabelsGroup, FLAGS_EVENT));
    return kind;
}
Also used : ContentValues(android.content.ContentValues) 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