Android QuickContactBadge - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android QuickContactBadge class.

This code example shows how to use the following methods: assignContactFromEmail, setMode
public class AvatarInflaterHelper extends AbstractAvatarInflaterHelper { 
 
	@Override 
	public void updateAvatar(ImageView avatar, AbstractContact abstractContact) {
		QuickContactBadge badge = (QuickContactBadge) avatar;
		badge.assignContactFromEmail(abstractContact.getUser(), true);
		badge.setMode(ContactsContract.QuickContact.MODE_SMALL);
	} 
 
} 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setExcludeMimes
    /** 
     * Returns the quick contact badge, creating it if necessary. 
     */ 
    public QuickContactBadge getQuickContact() {
        if (mQuickContact == null) {
            mQuickContact = new QuickContactBadge(mContext, null, QUICK_CONTACT_BADGE_STYLE);
            mQuickContact.setExcludeMimes(new String[] { Contacts.CONTENT_ITEM_TYPE });
            addView(mQuickContact);
        } 
        return mQuickContact;
    } 
 
    /** 
     * Returns the photo view, creating it if necessary. 
     */ 
    public ImageView getPhotoView() {
        if (mPhotoView == null) {
            mPhotoView = new ImageView(mContext, null, QUICK_CONTACT_BADGE_STYLE);
            // Quick contact style used above will set a background - remove it 
            mPhotoView.setBackgroundDrawable(null);
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: assignContactUri
This code example shows how to use the following methods: setImageDrawable, setVisibility, assignContactUri
                mAvatarView.assignContactFromPhone(contact.getNumber(), true);
            } 
        } else { 
            // TODO get a multiple recipients asset (or do something else) 
            avatarDrawable = sDefaultContactImage;
            mAvatarView.assignContactUri(null);
        } 
        mAvatarView.setImageDrawable(avatarDrawable);
        mAvatarView.setVisibility(View.VISIBLE);
    } 
 
    private void updateFromView() { 
        mFromView.setText(formatMessage());
        updateAvatarView(); 
    } 
 
    public void onUpdate(Contact updated) {
        if (Log.isLoggable(LogTag.CONTACT, Log.DEBUG)) {
            Log.v(TAG, "onUpdate: " + this + " contact: " + updated);
        } 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setLayoutParams, setImageURI, assignContactUri
	public String getAddress() {
		return address;
	} 
 
	public QuickContactBadge getBadge(Context context) {
		QuickContactBadge badge = new QuickContactBadge(context);
		badge.setLayoutParams(new LayoutParams(
				(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, BADGE_SIZE, context.getResources().getDisplayMetrics()),
				(int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, BADGE_SIZE, context.getResources().getDisplayMetrics())));
		if (contactId != -1) {
			badge.assignContactUri(getContactUri());
			badge.setImageURI(getPhotoUri(context));
		} else { 
			badge.setImageToDefault();
		} 
		return badge;
	} 
	 
	public boolean inRange(Vector<BluetoothDevice> neighbours) {
		for (BluetoothDevice d : neighbours) {
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android QuickContactBadge Questions & Answers:

See Code Examples for Android QuickContactBadge Methods: