public class RecipientEntry extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ENTRY_TYPE_PERMISSION_REQUEST
Entry of this type represents the item in auto-complete that asks user to grant permissions
to the app.
|
static int |
ENTRY_TYPE_PERSON |
static int |
ENTRY_TYPE_SIZE |
static int |
INVALID_DESTINATION_TYPE
Used when
mDestinationType is invalid and thus shouldn't be used for display. |
Modifier | Constructor and Description |
---|---|
protected |
RecipientEntry(int entryType,
String displayName,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
Uri photoThumbnailUri,
boolean shouldDisplayIcon,
boolean isFirstLevel,
boolean isValid,
String lookupKey,
String[] permissions) |
protected |
RecipientEntry(int entryType,
String displayName,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
Uri photoThumbnailUri,
boolean isFirstLevel,
boolean isValid,
String lookupKey) |
protected |
RecipientEntry(int entryType,
String displayName,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
Uri photoThumbnailUri,
boolean isFirstLevel,
boolean isValid,
String lookupKey,
String[] permissions) |
Modifier and Type | Method and Description |
---|---|
static RecipientEntry |
constructFakeEntry(String address,
boolean isValid)
Construct a RecipientEntry from just an address that has been entered.
|
static RecipientEntry |
constructFakePhoneEntry(String phoneNumber,
boolean isValid)
Construct a RecipientEntry from just a phone number.
|
static RecipientEntry |
constructGeneratedEntry(String display,
String address,
boolean isValid)
Construct a RecipientEntry from just an address that has been entered
with both an associated display name.
|
static RecipientEntry |
constructPermissionEntry(String[] permissions) |
static RecipientEntry |
constructSecondLevelEntry(String displayName,
int displayNameSource,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
String thumbnailUriAsString,
boolean isValid,
String lookupKey) |
static RecipientEntry |
constructTopLevelEntry(String displayName,
int displayNameSource,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
String thumbnailUriAsString,
boolean isValid,
String lookupKey) |
static RecipientEntry |
constructTopLevelEntry(String displayName,
int displayNameSource,
String destination,
int destinationType,
String destinationLabel,
long contactId,
Long directoryId,
long dataId,
Uri photoThumbnailUri,
boolean isValid,
String lookupKey) |
long |
getContactId() |
long |
getDataId() |
String |
getDestination() |
String |
getDestinationLabel() |
int |
getDestinationType() |
Long |
getDirectoryId() |
String |
getDisplayName() |
int |
getEntryType() |
int |
getIndicatorIconId()
Returns the resource ID for the indicator icon, or 0 if no icon should be displayed.
|
String |
getIndicatorText()
Get the indicator text, or null if no text should be displayed.
|
String |
getLookupKey() |
String[] |
getPermissions()
Used together with
ENTRY_TYPE_PERMISSION_REQUEST and indicates what permissions we
need to ask user to grant. |
byte[] |
getPhotoBytes()
This can be called outside main Looper thread.
|
Uri |
getPhotoThumbnailUri() |
static boolean |
isCreatedRecipient(long id)
Determine if this was a RecipientEntry created from recipient info or
an entry from contacts.
|
boolean |
isFirstLevel() |
boolean |
isSamePerson(RecipientEntry entry)
Returns if entry represents the same person as this instance.
|
boolean |
isSelectable() |
boolean |
isValid() |
void |
setIndicatorIconId(int indicatorIconId)
Sets the indicator icon to the given resource ID.
|
void |
setIndicatorText(String indicatorText)
Set the indicator text.
|
void |
setPhotoBytes(byte[] photoBytes)
This can be called outside main Looper thread.
|
boolean |
shouldDisplayIcon()
Indicates whether the icon in the chip is displayed or not.
|
String |
toString()
Returns a string representation of the object.
|
public static final int INVALID_DESTINATION_TYPE
mDestinationType
is invalid and thus shouldn't be used for display.public static final int ENTRY_TYPE_PERSON
public static final int ENTRY_TYPE_PERMISSION_REQUEST
Entries of this type should have mPermissions
set as well.
public static final int ENTRY_TYPE_SIZE
protected RecipientEntry(int entryType, String displayName, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, Uri photoThumbnailUri, boolean isFirstLevel, boolean isValid, String lookupKey, String[] permissions)
protected RecipientEntry(int entryType, String displayName, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, Uri photoThumbnailUri, boolean shouldDisplayIcon, boolean isFirstLevel, boolean isValid, String lookupKey, String[] permissions)
public boolean isValid()
public static boolean isCreatedRecipient(long id)
public static RecipientEntry constructFakeEntry(String address, boolean isValid)
public static RecipientEntry constructFakePhoneEntry(String phoneNumber, boolean isValid)
public static RecipientEntry constructGeneratedEntry(String display, String address, boolean isValid)
public static RecipientEntry constructTopLevelEntry(String displayName, int displayNameSource, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, Uri photoThumbnailUri, boolean isValid, String lookupKey)
public static RecipientEntry constructTopLevelEntry(String displayName, int displayNameSource, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, String thumbnailUriAsString, boolean isValid, String lookupKey)
public static RecipientEntry constructSecondLevelEntry(String displayName, int displayNameSource, String destination, int destinationType, String destinationLabel, long contactId, Long directoryId, long dataId, String thumbnailUriAsString, boolean isValid, String lookupKey)
public static RecipientEntry constructPermissionEntry(String[] permissions)
public int getEntryType()
public String getDisplayName()
public String getDestination()
public int getDestinationType()
public String getDestinationLabel()
public long getContactId()
public Long getDirectoryId()
public long getDataId()
public boolean isFirstLevel()
public Uri getPhotoThumbnailUri()
public boolean shouldDisplayIcon()
public void setPhotoBytes(byte[] photoBytes)
public byte[] getPhotoBytes()
public String[] getPermissions()
ENTRY_TYPE_PERMISSION_REQUEST
and indicates what permissions we
need to ask user to grant.public String getLookupKey()
public boolean isSelectable()
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
public boolean isSamePerson(RecipientEntry entry)
@DrawableRes public int getIndicatorIconId()
public void setIndicatorIconId(@DrawableRes int indicatorIconId)
public String getIndicatorText()
public void setIndicatorText(String indicatorText)