All favorites item change payload

master
Koitharu 2 years ago
parent 2450544454
commit a37e8825b0
Signed by: Koitharu
GPG Key ID: 676DEE768C17A9D7

@ -1,6 +1,7 @@
package org.koitharu.kotatsu.favourites.ui.categories.adapter
import org.koitharu.kotatsu.favourites.domain.model.Cover
import org.koitharu.kotatsu.list.ui.ListModelDiffCallback
import org.koitharu.kotatsu.list.ui.model.ListModel
data class AllCategoriesListModel(
@ -12,4 +13,12 @@ data class AllCategoriesListModel(
override fun areItemsTheSame(other: ListModel): Boolean {
return other is AllCategoriesListModel
}
override fun getChangePayload(previousState: ListModel): Any? {
return if (previousState is AllCategoriesListModel && previousState.isVisible != isVisible) {
ListModelDiffCallback.PAYLOAD_CHECKED_CHANGED
} else {
super.getChangePayload(previousState)
}
}
}

Loading…
Cancel
Save