14 lines
595 B
Kotlin
14 lines
595 B
Kotlin
package com.adlerosn.brasilfurfest.helper
|
|
|
|
import androidx.recyclerview.widget.DiffUtil
|
|
|
|
class ListDiffCallback(private val old: List<Any?>, private val new: List<Any?>) : DiffUtil.Callback() {
|
|
override fun getOldListSize(): Int = old.size
|
|
override fun getNewListSize(): Int = new.size
|
|
|
|
override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
|
|
areItemsTheSame(oldItemPosition, newItemPosition)
|
|
|
|
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean =
|
|
old[oldItemPosition] == new[newItemPosition]
|
|
} |