社区回答/文章列表增加防抖操作

This commit is contained in:
kehaoyuan@ghzhushou.com
2020-02-28 19:00:40 +08:00
parent 3eb1af7e23
commit c533cd021f

View File

@ -62,9 +62,11 @@ class CommunityAnswerItemViewHolder(val binding: CommunityAnswerItemBinding) : B
}
binding.voteButton.setOnClickListener {
CheckLoginUtils.checkLogin(itemView.context, entrance) {
if (!binding.voteIcon.isChecked) voteAnswer(entity)
else cancelAnswerVote(entity)
debounceActionWithInterval(R.id.container_like, 1000) {
CheckLoginUtils.checkLogin(itemView.context, entrance) {
if (!binding.voteIcon.isChecked) voteAnswer(entity)
else cancelAnswerVote(entity)
}
}
}
}
@ -82,9 +84,11 @@ class CommunityAnswerItemViewHolder(val binding: CommunityAnswerItemBinding) : B
}
binding.voteButton.setOnClickListener {
CheckLoginUtils.checkLogin(itemView.context, entrance) {
if (!binding.voteIcon.isChecked) voteArticle(entity)
else cancelArticleVote(entity)
debounceActionWithInterval(R.id.container_like, 1000) {
CheckLoginUtils.checkLogin(itemView.context, entrance) {
if (!binding.voteIcon.isChecked) voteArticle(entity)
else cancelArticleVote(entity)
}
}
}
}