|
|
|
@ -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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |