예제 #1
0
 @Override
 public int getItemViewType(int position) {
   DMBean dmBean = bean.get(position);
   if (dmBean.getUser().getId().equals(GlobalContext.getInstance().getCurrentAccountId())) {
     return TYPE_MYSELF;
   } else {
     return TYPE_NORMAL;
   }
 }
예제 #2
0
  protected void bindViewData(DMViewHolder holder, int position) {

    final DMBean msg = bean.get(position);
    UserBean user = msg.getUser();
    if (user != null) {
      buildAvatar(holder.avatar, position, user);
    } else {
      holder.avatar.setVisibility(View.INVISIBLE);
    }

    if (!TextUtils.isEmpty(msg.getListViewSpannableString())) {
      holder.content.setText(msg.getListViewSpannableString());
    } else {
      TimeLineUtility.addJustHighLightLinks(msg);
      holder.content.setText(msg.getListViewSpannableString());
    }
    String time = msg.getListviewItemShowTime();

    if (!holder.time.getText().toString().equals(time)) {
      holder.time.setText(time);
    }
    holder.time.setTag(msg.getId());
  }