pull/32/head
kunfei 5 years ago
parent 909c6028f2
commit d033b4e68d
  1. 11
      app/src/main/java/io/legado/app/ui/changesource/DiffCallBack.kt

@ -21,7 +21,16 @@ class DiffCallBack(private val oldItems: List<SearchBook>, 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
}
}
Loading…
Cancel
Save