use of me.zhanghai.android.douya.network.api.info.frodo.Comment in project Douya by DreaminginCodeZH.
the class CommentListResource method onCommentDeleted.
@Subscribe(threadMode = ThreadMode.POSTING)
public void onCommentDeleted(CommentDeletedEvent event) {
if (event.isFromMyself(this) || isEmpty()) {
return;
}
List<Comment> commentList = get();
for (int i = 0, size = commentList.size(); i < size; ) {
Comment comment = commentList.get(i);
if (comment.id == event.commentId) {
commentList.remove(i);
getListener().onCommentRemoved(getRequestCode(), i);
--size;
} else {
++i;
}
}
}
use of me.zhanghai.android.douya.network.api.info.frodo.Comment in project Douya by DreaminginCodeZH.
the class CommentAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Comment comment = getItem(position);
ImageUtils.loadAvatar(holder.avatarImage, comment.author.avatar);
Context context = RecyclerViewUtils.getContext(holder);
holder.avatarImage.setOnClickListener(view -> context.startActivity(ProfileActivity.makeIntent(comment.author, context)));
holder.nameText.setText(comment.author.name);
holder.timeText.setDoubanTime(comment.createTime);
holder.textText.setText(comment.getTextWithEntities());
}