I'm pretty sure that my list has changed but the view not updated
I'm using submitList
like this:
recentChatsAdapter.submitList(recentChats?.let { ArrayList<Conversation>(it) })
DiffUtil code:
class ChatDiffUtil: DiffUtil.ItemCallback<Conversation>() {
override fun areItemsTheSame(oldItem: Conversation, newItem: Conversation): Boolean {
return oldItem.chatId == newItem.chatId
}
override fun areContentsTheSame(oldItem: Conversation, newItem: Conversation): Boolean {
return oldItem == newItem
}
}
I saw this question and this one
but I didn't find any solution to my problem.