Ejemplo n.º 1
0
  private void updateAvatarView() {
    MultiDeleteListItemData ch = mMultiDeleteThreadData;

    Drawable avatarDrawable;
    if (ch.getContacts().size() == 1) {
      Contact contact = ch.getContacts().get(0);
      avatarDrawable = contact.getAvatar(mContext, sDefaultContactImage);

      if (contact.existsInDatabase()) {
        mAvatarView.assignContactUri(contact.getUri());
      } else {
        mAvatarView.assignContactFromPhone(contact.getNumber(), true);
      }
    } else {
      // TODO get a multiple recipients asset (or do something else)
      avatarDrawable = sDefaultContactImage;
      mAvatarView.assignContactUri(null);
    }
    mAvatarView.setImageDrawable(avatarDrawable);
  }
Ejemplo n.º 2
0
  public final void bind(Context context, final MultiDeleteListItemData ch) {
    setMultiDeleteHeader(ch);

    // Date
    mDateView.setText(ch.getDate());

    // From.
    mFromView.setText(formatMessage(ch));

    // Register for updates in changes of any of the contacts in this conversation.
    ContactList contacts = ch.getContacts();
    Contact.addListener(this);

    // Subject
    mSubjectView.setText(ch.getSubject());
    mSubjectView.setSingleLine(true);
    mSubjectView.setEllipsize(TextUtils.TruncateAt.END);
    updateAvatarView();
    mCheckbox.setChecked(ch.isSelected());
  }