Add extra to exclude specific MIME-types from Fast-Track.

Also added ContactHeaderWidget accessor for passing along
this list when triggering Fast-Track.  This is used so that
the header widget can hide the profile icon when launched
while already looking at the profile.
This commit is contained in:
Jeff Sharkey
2009-08-23 14:07:02 -07:00
parent 06a0323a54
commit 84235ee923
2 changed files with 22 additions and 0 deletions

View File

@@ -1772,6 +1772,13 @@ public final class ContactsContract {
*/ */
public static final int MODE_LARGE = 3; public static final int MODE_LARGE = 3;
/**
* Optional extra used with {@link #SHOW_OR_CREATE_CONTACT} to indicate
* a list of specific MIME-types to exclude and not display. Stored as a
* {@link String} array.
*/
public static final String EXTRA_EXCLUDE_MIMES = "exclude_mimes";
/** /**
* Intents related to the Contacts app UI. * Intents related to the Contacts app UI.
*/ */

View File

@@ -80,6 +80,8 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
protected Uri mContactUri; protected Uri mContactUri;
protected Uri mStatusUri; protected Uri mStatusUri;
protected String[] mExcludeMimes = null;
protected ContentResolver mContentResolver; protected ContentResolver mContentResolver;
/** /**
@@ -291,6 +293,15 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
mStatusView.setText(snippet); mStatusView.setText(snippet);
} }
/**
* Set a list of specific MIME-types to exclude and not display. For
* example, this can be used to hide the {@link Contacts#CONTENT_ITEM_TYPE}
* profile icon.
*/
public void setExcludeMimes(String[] excludeMimes) {
mExcludeMimes = excludeMimes;
}
/** /**
* Convenience method for binding all available data from an existing * Convenience method for binding all available data from an existing
* contact. * contact.
@@ -428,6 +439,10 @@ public class ContactHeaderWidget extends FrameLayout implements View.OnClickList
final Rect target = getTargetRect(view); final Rect target = getTargetRect(view);
intent.putExtra(Intents.EXTRA_TARGET_RECT, target); intent.putExtra(Intents.EXTRA_TARGET_RECT, target);
intent.putExtra(Intents.EXTRA_MODE, Intents.MODE_SMALL); intent.putExtra(Intents.EXTRA_MODE, Intents.MODE_SMALL);
if (mExcludeMimes != null) {
// Exclude specific MIME-types when requested
intent.putExtra(Intents.EXTRA_EXCLUDE_MIMES, mExcludeMimes);
}
mContext.startActivity(intent); mContext.startActivity(intent);
break; break;
} }