Example usage for android.widget QuickContactBadge QuickContactBadge

List of usage examples for android.widget QuickContactBadge QuickContactBadge

Introduction

In this page you can find the example usage for android.widget QuickContactBadge QuickContactBadge.

Prototype

public QuickContactBadge(Context context) 

Source Link

Usage

From source file:com.android.contacts.common.list.ContactListItemView.java

/**
 * Returns the quick contact badge, creating it if necessary.
 *///w ww  . j a v  a2s. c o  m
public QuickContactBadge getQuickContact() {
    if (!mQuickContactEnabled) {
        throw new IllegalStateException("QuickContact is disabled for this view");
    }
    if (mQuickContact == null) {
        mQuickContact = new QuickContactBadge(getContext());
        if (CompatUtils.isLollipopCompatible()) {
            mQuickContact.setOverlay(null);
        }
        mQuickContact.setLayoutParams(getDefaultPhotoLayoutParams());
        if (mNameTextView != null) {
            mQuickContact.setContentDescription(
                    getContext().getString(R.string.description_quick_contact_for, mNameTextView.getText()));
        }

        addView(mQuickContact);
        mPhotoViewWidthAndHeightAreReady = false;
    }
    return mQuickContact;
}