Replace notifyDataSetChanged

This commit is contained in:
Bnyro 2022-05-08 21:35:45 +02:00
parent dfb32d4b64
commit 2d4e70bd69

View File

@ -16,7 +16,7 @@ class CommentsAdapter(private val comments: MutableList<Comment>): RecyclerView
fun updateItems(newItems: List<Comment>){ fun updateItems(newItems: List<Comment>){
comments.addAll(newItems) comments.addAll(newItems)
notifyDataSetChanged() notifyItemRangeInserted(comments.size, newItems.size)
} }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {