|
|
@@ -42,6 +42,15 @@ public class AdpArticleComment extends BaseQuickAdapter<UserComment, BaseViewHol
|
|
|
this.hasCommentDetail = hasCommentDetail;
|
|
|
return this;
|
|
|
}
|
|
|
+ private int total = 0;
|
|
|
+
|
|
|
+ public void setTotal(int total) {
|
|
|
+ this.total = total;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int getTotal() {
|
|
|
+ return total;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
protected void convert(BaseViewHolder helper, final UserComment item) {
|
|
|
@@ -62,7 +71,11 @@ public class AdpArticleComment extends BaseQuickAdapter<UserComment, BaseViewHol
|
|
|
ViewUtil.setText(article_comment_num2, item.getLike());
|
|
|
ViewUtil.setText(article_comment_num3, item.getExpression());
|
|
|
ViewUtil.setText(article_comment_user_name, item.getNickname());
|
|
|
- ViewUtil.setText(article_comment_time_tv, String.format(Locale.CHINA, "%d楼\u3000%s", position + 1, TimeUtil.TimeStamp2Date(item.getCreate_time(), "yyyy-MM-dd\u0020hh:mm")));
|
|
|
+ if(total == 0){
|
|
|
+ ViewUtil.setText(article_comment_time_tv, TimeUtil.TimeStamp2Date(item.getCreate_time(), "yyyy-MM-dd\u0020hh:mm"));
|
|
|
+ } else {
|
|
|
+ ViewUtil.setText(article_comment_time_tv, String.format(Locale.CHINA, "%d楼\u3000%s", total - position, TimeUtil.TimeStamp2Date(item.getCreate_time(), "yyyy-MM-dd\u0020hh:mm")));
|
|
|
+ }
|
|
|
//String.format(Locale.CHINA, "%d %d %d %d", position, helper.getAdapterPosition(), helper.getLayoutPosition(), helper.getOldPosition()));
|
|
|
TextViewUtil.initIntroView(helper.itemView, item.getShowAll());
|
|
|
ViewUtil.setVisibility(article_comment_num1, hasCommentDetail);
|