Search in sources :

Example 1 with BaseActivity

use of com.rideread.rideread.common.base.BaseActivity in project ride-read-android by Ride-Read.

the class CommentsAdapter method getItemView.

@Override
public View getItemView(int position, View convertView, ViewHolder viewHolder, ViewGroup viewGroup) {
    SimpleDraweeView sdv_thumb_avatar = viewHolder.getView(R.id.sdv_thumb_avatar);
    TextView tv_thumb_username = viewHolder.getView(R.id.tv_thumb_username);
    TextView tv_thumb_time = viewHolder.getView(R.id.tv_thumb_time);
    TextView tv_thumb_content = viewHolder.getView(R.id.tv_thumb_content);
    Comment comment = getItem(position);
    ImgLoader.getInstance().displayImage(comment.getFaceUrl(), sdv_thumb_avatar);
    tv_thumb_username.setText(comment.getUsername());
    tv_thumb_time.setText(TimeUtils.getFriendlyTimeSpanByNow(comment.getCreatedAt()));
    tv_thumb_content.setText(comment.getMsg());
    sdv_thumb_avatar.setOnClickListener(v -> {
        Bundle bundle = new Bundle();
        bundle.putInt(UserMomentsActivity.SELECTED_UID, comment.getUid());
        bundle.putString(UserMomentsActivity.SELECTED_USERNAME, comment.getUsername());
        ((BaseActivity) mContext).gotoActivity(UserMomentsActivity.class, bundle);
    });
    return convertView;
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) Comment(com.rideread.rideread.data.result.Comment) Bundle(android.os.Bundle) BaseActivity(com.rideread.rideread.common.base.BaseActivity) TextView(android.widget.TextView)

Aggregations

Bundle (android.os.Bundle)1 TextView (android.widget.TextView)1 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)1 BaseActivity (com.rideread.rideread.common.base.BaseActivity)1 Comment (com.rideread.rideread.data.result.Comment)1