List of usage examples for android.widget QuickContactBadge assignContactUri
public void assignContactUri(Uri contactUri)
From source file:com.android.mms.quickmessage.QuickMessage.java
private void updateContactBadge(QuickContactBadge badge, String addr, boolean isSelf) { Drawable avatarDrawable;/*from w w w.j a va 2s. com*/ if (isSelf || !TextUtils.isEmpty(addr)) { Contact contact = isSelf ? Contact.getMe(false) : Contact.get(addr, false); avatarDrawable = contact.getAvatar(mContext, mDefaultContactImage); if (isSelf) { badge.assignContactUri(Profile.CONTENT_URI); } else { if (contact.existsInDatabase()) { badge.assignContactUri(contact.getUri()); } else { badge.assignContactFromPhone(contact.getNumber(), true); } } } else { avatarDrawable = mDefaultContactImage; } badge.setImageDrawable(avatarDrawable); }
From source file:com.android.mms.quickmessage.QuickMessagePopup.java
/** * Show the appropriate image for the QuickContact badge * * @param badge//from www . j a va 2s. com * @param addr * @param isSelf */ private void updateContactBadge(QuickContactBadge badge, String addr, boolean isSelf) { Drawable avatarDrawable; if (isSelf || !TextUtils.isEmpty(addr)) { Contact contact = isSelf ? Contact.getMe(false) : Contact.get(addr, false); avatarDrawable = contact.getAvatar(mContext, mDefaultContactImage); if (isSelf) { badge.assignContactUri(Profile.CONTENT_URI); } else { if (contact.existsInDatabase()) { badge.assignContactUri(contact.getUri()); } else { badge.assignContactFromPhone(contact.getNumber(), true); } } } else { avatarDrawable = mDefaultContactImage; } badge.setImageDrawable(avatarDrawable); }