Example usage for android.widget QuickContactBadge setMode

List of usage examples for android.widget QuickContactBadge setMode

Introduction

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

Prototype

@SuppressWarnings("unused")
public void setMode(int size) 

Source Link

Document

This call has no effect anymore, as there is only one QuickContact mode

Usage

From source file:net.vivekiyer.GAL.CorporateContactRecordFragment.java

private void setContact() {
    final View view = getView();

    m_adapter = new ContactDetailsAdapter(this.getActivity(), R.layout.detail_row, mContact.getDetails());
    setListAdapter(m_adapter);/*from  w w w.j  a v  a 2 s.c  om*/

    final TextView tv1 = (TextView) view.findViewById(R.id.toptext);
    tv1.setText(mContact.getDisplayName());

    final TextView tv2 = (TextView) view.findViewById(R.id.bottomtext);
    // Set the bottom text
    if (tv2 != null) {
        String s;
        if ((s = mContact.getTitle()).length() != 0)
            s = s + ", "; //$NON-NLS-1$
        {
            tv2.setText(s + mContact.getCompany());
        }
    }

    QuickContactBadge qcb = (QuickContactBadge) view.findViewById(R.id.contactPicture);
    qcb.assignContactFromEmail(mContact.getEmail(), true);
    qcb.setMode(ContactsContract.QuickContact.MODE_LARGE);
    byte[] pic;
    if ((pic = mContact.getPicture()) != null) {
        Bitmap bm = BitmapFactory.decodeByteArray(pic, 0, pic.length);
        qcb.setImageBitmap(bm);
    }

    // getListView().setOnItemLongClickListener(mListViewLongClickListener);
    contactWriter = new ContactWriterSdk5(App.getInstance(), mContact);

    view.findViewById(R.id.contactHeader).setVisibility(View.VISIBLE);
    setSaveMenuEnabled(true);
}