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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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
Experience pair programming with AI  Get Codota for Java
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() { 
        ConversationHeader ch = mConversationHeader;
        ch.updateRecipients();
        mFromView.setText(formatMessage(ch));
        setPresenceIcon(ch.getContacts().getPresenceResId());
        updateAvatarView(); 
    } 
 
    public void onUpdate(Contact updated) {
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageDrawable, assignContactFromPhone, assignContactUri
        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);
    } 
 
    private void sendQuickMessage(String message) {

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods: setImageDrawable, assignContactUri
	public static void setupBadge(QuickContactBadge badge, Entity e,
			IDataModel manager) {
 
		Uri lookup_uri = manager.getContactUri(e);
 
		badge.assignContactUri(lookup_uri);
 
		badge.setImageDrawable(manager.getPicture(e));
 
	} 
} 
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java
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_LARGE);
	} 
 
} 
Full Snippet Info
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Android QuickContactBadge Questions & Answers:

See Code Examples for Android QuickContactBadge Methods: