From 7bfe38093a0f86a2b1b42856c958f3b85fc41c12 Mon Sep 17 00:00:00 2001 From: Matthew Horan Date: Sat, 7 Dec 2024 13:11:51 -0500 Subject: [PATCH] Compare line ID when diffing if available --- .../com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt b/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt index 3be7bab4..b6b2ac03 100644 --- a/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt +++ b/app/src/main/java/com/ubergeek42/WeechatAndroid/adapters/ChatLinesAdapter.kt @@ -332,6 +332,9 @@ class ChatLinesAdapter @MainThread constructor( override fun getNewListSize() = newLines.size override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean { + if (oldLines[oldItemPosition].id != null) { + return oldLines[oldItemPosition].id == newLines[newItemPosition].id + } return oldLines[oldItemPosition].pointer == newLines[newItemPosition].pointer }