adding a helper function for updating conversations, if necessary
This commit is contained in:
parent
7a7b1aab32
commit
a013c110ec
2 changed files with 27 additions and 10 deletions
|
|
@ -173,6 +173,15 @@ class ConversationsAdapter(activity: SimpleActivity, var conversations: ArrayLis
|
|||
}
|
||||
}
|
||||
|
||||
fun updateConversations(newConversations: ArrayList<Conversation>) {
|
||||
val oldHashCode = conversations.hashCode()
|
||||
val newHashCode = newConversations.hashCode()
|
||||
if (newHashCode != oldHashCode) {
|
||||
conversations = newConversations
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupView(view: View, conversation: Conversation) {
|
||||
view.apply {
|
||||
conversation_frame.isSelected = selectedKeys.contains(conversation.system_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue