Callback

abstract class Callback(source)

A Callback class used by DiffUtil while calculating the diff between two lists.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun areContentsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean
Called by the DiffUtil when it wants to check whether two items have the same data.
Link copied to clipboard
abstract fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean
Called by the DiffUtil to decide whether two object represent the same Item.
Link copied to clipboard
open fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any
When areItemsTheSame returns true for two items and areContentsTheSame returns false for them, DiffUtil calls this method to get a payload about the change.
Link copied to clipboard
abstract fun getNewListSize(): Int
Returns the size of the new list.
Link copied to clipboard
abstract fun getOldListSize(): Int
Returns the size of the old list.