/* * * /** {@inheritDoc} */ @Override public final void bindView(final View view, final Context context, final Cursor cursor) { final Conversation c = Conversation.getConversation(context, cursor, false); final Contact contact = c.getContact(); ViewHolder holder = (ViewHolder) view.getTag(); if (holder == null) { holder = new ViewHolder(); holder.tvPerson = (TextView) view.findViewById(R.id.addr); holder.tvCount = (TextView) view.findViewById(R.id.count); holder.tvBody = (TextView) view.findViewById(R.id.body); holder.tvDate = (TextView) view.findViewById(R.id.date); holder.ivPhoto = (ImageView) view.findViewById(R.id.photo); holder.vRead = view.findViewById(R.id.read); view.setTag(holder); } if (useGridLayout) { holder.tvCount.setVisibility(View.GONE); } else { final int count = c.getCount(); if (count < 0) { holder.tvCount.setText(""); } else { holder.tvCount.setText("(" + c.getCount() + ")"); } } if (textSize > 0) { holder.tvBody.setTextSize(textSize); } final int col = textColor; if (col != 0) { holder.tvPerson.setTextColor(col); holder.tvBody.setTextColor(col); holder.tvCount.setTextColor(col); holder.tvDate.setTextColor(col); } if (useGridLayout || ConversationListActivity.showContactPhoto) { holder.ivPhoto.setImageDrawable(contact.getAvatar(activity, defaultContactAvatar)); holder.ivPhoto.setVisibility(View.VISIBLE); if (!useGridLayout) { holder.ivPhoto.setOnClickListener( WRAPPER.getQuickContact( context, holder.ivPhoto, contact.getLookUpUri(context.getContentResolver()), 2, null)); } } else { holder.ivPhoto.setVisibility(View.GONE); } if (isBlocked(contact.getNumber())) { holder.tvPerson.setText("[" + contact.getDisplayName() + "]"); } else { holder.tvPerson.setText(contact.getDisplayName()); } // read status if (c.getRead() == 0) { holder.vRead.setVisibility(View.VISIBLE); } else { holder.vRead.setVisibility(View.INVISIBLE); } // body CharSequence text = c.getBody(); if (text == null) { text = context.getString(R.string.mms_conversation); } if (convertNCR) { text = Converter.convertDecNCR2Char(text); } if (showEmoticons) { text = SmileyParser.getInstance(context).addSmileySpans(text); } holder.tvBody.setText(text); // date long time = c.getDate(); holder.tvDate.setText(ConversationListActivity.getDate(context, time)); // presence ImageView ivPresence = (ImageView) view.findViewById(R.id.presence); if (contact.getPresenceState() > 0) { ivPresence.setImageResource(Contact.getPresenceRes(contact.getPresenceState())); ivPresence.setVisibility(View.VISIBLE); } else { ivPresence.setVisibility(View.GONE); } }