tweak the way adapters are updated

This commit is contained in:
tibbi 2021-05-23 17:53:18 +02:00
parent 9c0ef0fbe9
commit b02b54b055
2 changed files with 6 additions and 4 deletions

View file

@ -209,10 +209,11 @@ class ConversationsAdapter(
}
fun updateConversations(newConversations: ArrayList<Conversation>) {
val latestConversations = newConversations.clone() as ArrayList<Conversation>
val oldHashCode = conversations.hashCode()
val newHashCode = newConversations.hashCode()
val newHashCode = latestConversations.hashCode()
if (newHashCode != oldHashCode) {
conversations = newConversations
conversations = latestConversations
notifyDataSetChanged()
}
}