Callback

The class that controls the behavior of the SortedList.

It defines how items should be sorted and how duplicates should be handled.

SortedList calls the callback methods on this class to notify changes about the underlying data.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun areContentsTheSame(oldItem: T2, newItem: T2): Boolean
Called by the SortedList when it wants to check whether two items have the same data or not.
Link copied to clipboard
abstract fun areItemsTheSame(item1: T2, item2: T2): Boolean
Called by the SortedList to decide whether two objects represent the same Item or not.
Link copied to clipboard
abstract fun compare(o1: T2, o2: T2): Int
Similar to compare, should compare two and return how they should be ordered.
Link copied to clipboard
open fun getChangePayload(item1: T2, item2: T2): Any
When areItemsTheSame returns true for two items and areContentsTheSame returns false for them, Callback calls this method to get a payload about the change.
Link copied to clipboard
abstract fun onChanged(position: Int, count: Int)
Called by the SortedList when the item at the given position is updated.
open fun onChanged(position: Int, count: Int, payload: Any)
Called when count} number of items are updated at the given position.