本文整理汇总了Java中android.provider.ContactsContract.CommonDataKinds.Email.TYPE_OTHER属性的典型用法代码示例。如果您正苦于以下问题:Java Email.TYPE_OTHER属性的具体用法?Java Email.TYPE_OTHER怎么用?Java Email.TYPE_OTHER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.provider.ContactsContract.CommonDataKinds.Email
的用法示例。
在下文中一共展示了Email.TYPE_OTHER属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAndroidEmailType
public static int getAndroidEmailType(EmailType emailType) {
switch (emailType) {
case TYPE_CUSTOM:
return Email.TYPE_CUSTOM;
case TYPE_HOME:
return Email.TYPE_HOME;
case TYPE_MOBILE:
return Email.TYPE_MOBILE;
case TYPE_OTHER:
return Email.TYPE_OTHER;
case TYPE_WORK:
return Email.TYPE_WORK;
default:
return Email.TYPE_OTHER;
}
}
示例2: getEmailType
public static EmailType getEmailType(int androidEmailType) {
switch (androidEmailType) {
case Email.TYPE_CUSTOM:
return EmailType.TYPE_CUSTOM;
case Email.TYPE_OTHER:
return EmailType.TYPE_OTHER;
case Email.TYPE_HOME:
return EmailType.TYPE_HOME;
case Email.TYPE_WORK:
return EmailType.TYPE_WORK;
case Email.TYPE_MOBILE:
return EmailType.TYPE_MOBILE;
default:
return EmailType.TYPE_OTHER;
}
}
示例3: buildEmail
protected Builder buildEmail(Builder builder, ezvcard.property.Email email) {
int typeCode = 0;
String typeLabel = null;
boolean is_primary = false;
for (EmailType type : email.getTypes())
if (type == EmailType.PREF)
is_primary = true;
else if (type == EmailType.HOME)
typeCode = Email.TYPE_HOME;
else if (type == EmailType.WORK)
typeCode = Email.TYPE_WORK;
else if (type == Contact.EMAIL_TYPE_MOBILE)
typeCode = Email.TYPE_MOBILE;
if (typeCode == 0) {
if (email.getTypes().isEmpty())
typeCode = Email.TYPE_OTHER;
else {
typeCode = Email.TYPE_CUSTOM;
typeLabel = xNameToLabel(email.getTypes().iterator().next().getValue());
}
}
builder = builder
.withValue(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE)
.withValue(Email.ADDRESS, email.getValue())
.withValue(Email.TYPE, typeCode)
.withValue(Email.IS_PRIMARY, is_primary ? 1 : 0)
.withValue(Phone.IS_SUPER_PRIMARY, is_primary ? 1 : 0);;
if (typeLabel != null)
builder = builder.withValue(Email.LABEL, typeLabel);
return builder;
}
示例4: getEmailTypeLabel
private String getEmailTypeLabel(int type, String label) {
switch (type) {
case Email.TYPE_HOME:
return getString(R.string.label_hometag);
case Email.TYPE_WORK:
return getString(R.string.label_worktag);
case Email.TYPE_MOBILE:
return getString(R.string.label_mobiletag);
case Email.TYPE_OTHER:
return getString(R.string.label_othertag);
default:
return Email.getTypeLabel(this.getResources(), type, label).toString();
}
}
示例5: appendEmailLine
public void appendEmailLine(final int type, final String label,
final String rawValue, final boolean isPrimary) {
final String typeAsString;
switch (type) {
case Email.TYPE_CUSTOM: {
if (VCardUtils.isMobilePhoneLabel(label)) {
typeAsString = VCardConstants.PARAM_TYPE_CELL;
} else if (!TextUtils.isEmpty(label)
&& VCardUtils.containsOnlyAlphaDigitHyphen(label)) {
typeAsString = "X-" + label;
} else {
typeAsString = null;
}
break;
}
case Email.TYPE_HOME: {
typeAsString = VCardConstants.PARAM_TYPE_HOME;
break;
}
case Email.TYPE_WORK: {
typeAsString = VCardConstants.PARAM_TYPE_WORK;
break;
}
case Email.TYPE_OTHER: {
typeAsString = null;
break;
}
case Email.TYPE_MOBILE: {
typeAsString = VCardConstants.PARAM_TYPE_CELL;
break;
}
default: {
Log.e(LOG_TAG, "Unknown Email type: " + type);
typeAsString = null;
break;
}
}
final List<String> parameterList = new ArrayList<>();
if (isPrimary) {
parameterList.add(VCardConstants.PARAM_TYPE_PREF);
}
if (!TextUtils.isEmpty(typeAsString)) {
parameterList.add(typeAsString);
}
appendLineWithCharsetAndQPDetection(VCardConstants.PROPERTY_EMAIL, parameterList,
rawValue);
}