package mx.trackermap.TrackerMap.android.devices import androidx.recyclerview.widget.DiffUtil import mx.trackermap.TrackerMap.client.models.UnitInformation class DevicesDiffCallback( private val oldList: List, private val newList: List ): DiffUtil.Callback() { override fun getOldListSize() = oldList.size override fun getNewListSize() = newList.size override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int) = oldList[oldItemPosition].device.id == newList[newItemPosition].device.id override fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int) = (oldList[oldItemPosition].position?.id == newList[newItemPosition].position?.id) && newItemPosition != 0 }