修改视频评论作者标记显示错误

This commit is contained in:
张玉久
2020-08-24 11:53:42 +08:00
parent ad2a0debdd
commit c9e8408804
3 changed files with 51 additions and 10 deletions

View File

@ -63,6 +63,12 @@ class StairsCommentReplyAdapter(context: Context, val mViewModel: NewCommentView
holder.binding.sdvUserBadge.visibility = View.GONE
holder.binding.commentUserName.textSize = 12f
if (commentEntity.reply == 0) {
val params = holder.binding.commentUsernameAndTime.layoutParams as RelativeLayout.LayoutParams
params.bottomMargin = 0
holder.binding.commentUsernameAndTime.layoutParams = params
}
}
}
}

View File

@ -57,11 +57,14 @@ class StairsCommentViewHolder(val binding: StairsCommentItemBinding, val isReply
binding.commentAuthor.visibility = View.GONE
}
if (parentUser != null && !TextUtils.isEmpty(parentUser.name)) {
val name = "${entity.user.name} 回复 ${parentUser.name}"
binding.commentUserName.text = SpanBuilder(name).color((entity.user.name?.length
?: 0) + 1, (entity.user.name?.length ?: 0) + 3, R.color.text_666666).build()
binding.commentUserName.text = entity.user.name
binding.replyTv.visibility = View.VISIBLE
binding.commentReplyUserName.visibility = View.VISIBLE
binding.commentReplyUserName.text = parentUser.name
} else {
binding.commentUserName.text = userInfo.name
binding.replyTv.visibility = View.GONE
binding.commentReplyUserName.visibility = View.GONE
}
if (userInfo.auth != null) {
display(binding.commentUserBadge, userInfo.auth!!.icon)
@ -76,11 +79,14 @@ class StairsCommentViewHolder(val binding: StairsCommentItemBinding, val isReply
binding.commentAuthor.visibility = View.GONE
}
if (parentUser != null && !TextUtils.isEmpty(parentUser.name)) {
val name = "${entity.user.name} 回复 ${parentUser.name}"
binding.commentUserName.text = SpanBuilder(name).color((entity.user.name?.length
?: 0) + 1, (entity.user.name?.length ?: 0) + 3, R.color.text_666666).build()
binding.commentUserName.text = entity.user.name
binding.replyTv.visibility = View.VISIBLE
binding.commentReplyUserName.visibility = View.VISIBLE
binding.commentReplyUserName.text = parentUser.name
} else {
binding.commentUserName.text = entity.user.name
binding.replyTv.visibility = View.GONE
binding.commentReplyUserName.visibility = View.GONE
}
if (entity.user.auth != null) {
display(binding.commentUserBadge, entity.user.auth!!.icon)