<string name="organizationLabelsGroup">Organization</string>
<!-- Header that expands to list all website types when editing a website of a contact -->
<string name="websiteLabelsGroup">Website</string>
+ <!-- Header that expands to list all event types when editing an event of a contact -->
+ <string name="eventLabelsGroup">Event</string>
<!-- Single-character overlay for home phone numbers when creating desktop shortcuts -->
<string name="type_short_home">H</string>
<string name="split_label">Split</string>
<!-- The explanation of what "split" will do. This needs word-smithing. -->
<string name="split_explanation">Make this data its own contact.</string>
-
+
<!-- Formatting string for account name -->
<string name="account_name_format">From <xliff:g id="source" example="Gmail">%1$s</xliff:g> account: <xliff:g id="account" example="user@gmail.com">%2$s</xliff:g></string>
import android.database.Cursor;
import android.provider.ContactsContract.CommonDataKinds.BaseTypes;
import android.provider.ContactsContract.CommonDataKinds.Email;
+import android.provider.ContactsContract.CommonDataKinds.Event;
import android.provider.ContactsContract.CommonDataKinds.Im;
import android.provider.ContactsContract.CommonDataKinds.Nickname;
import android.provider.ContactsContract.CommonDataKinds.Note;
inflatePhoto(inflateLevel);
inflateNote(inflateLevel);
inflateWebsite(inflateLevel);
+ inflateEvent(inflateLevel);
setInflatedLevel(inflateLevel);
return kind;
}
+ protected DataKind inflateEvent(int inflateLevel) {
+ DataKind kind = getKindForMimetype(Event.CONTENT_ITEM_TYPE);
+ if (kind == null) {
+ kind = addKind(new DataKind(Event.CONTENT_ITEM_TYPE,
+ R.string.eventLabelsGroup, -1, 150, false));
+ kind.secondary = true;
+ kind.actionHeader = new EventActionInflater();
+ kind.actionBody = new SimpleInflater(Event.START_DATE);
+ }
+
+ return kind;
+ }
+
/**
* Simple inflater that assumes a string resource has a "%s" that will be
* filled from the given column.
}
}
+ public static class EventActionInflater extends CommonInflater {
+ @Override
+ protected int getTypeLabelResource(Integer type) {
+ return Event.getTypeResource(type);
+ }
+ }
+
public static class PostalActionInflater extends CommonInflater {
@Override
protected int getTypeLabelResource(Integer type) {