From d033b4e68dd84144383a6fe4f7102f3d73d43d8a Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 20 Aug 2019 09:05:07 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/changesource/DiffCallBack.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/changesource/DiffCallBack.kt b/app/src/main/java/io/legado/app/ui/changesource/DiffCallBack.kt index 2183c51e5..2cb911204 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/DiffCallBack.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/DiffCallBack.kt @@ -21,7 +21,16 @@ class DiffCallBack(private val oldItems: List, private val newItems: override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean { return oldItems[oldItemPosition].originName == newItems[newItemPosition].originName - && oldItems[oldItemPosition].latestChapterTitle == newItems[newItemPosition].originName + && oldItems[oldItemPosition].latestChapterTitle == newItems[newItemPosition].latestChapterTitle + } + + override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? { + val oldItem = oldItems[oldItemPosition] + val newItem = newItems[newItemPosition] + if (oldItem.originName != newItem.originName || oldItem.latestChapterTitle != newItem.latestChapterTitle) { + return true + } + return null } } \ No newline at end of file