DiffCallback
abstract class DiffCallback<Value>
GuidedActionDiffCallback |
DiffCallback used for GuidedActions, see |
Callback that informs ArrayObjectAdapter how to compute list updates when using DiffUtil in setItems method.
The setItems method will pass items from different lists to this callback in order to implement the DiffUtil.Callback it uses to compute differences between lists.
| Parameters | |
|---|---|
<Value> |
Type of items to compare. |
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
abstract Boolean |
areContentsTheSame(oldItem: Value, newItem: Value)Called to decide whether two items have the same data. |
abstract Boolean |
areItemsTheSame(oldItem: Value, newItem: Value)Called to decide whether two objects represent the same item. |
Any? |
getChangePayload(oldItem: Value, newItem: Value)Called to get a change payload between an old and new version of an item. |
Public constructors
Public functions
areContentsTheSame
abstract fun areContentsTheSame(oldItem: Value, newItem: Value): Boolean
Called to decide whether two items have the same data. This information is used to detect if the contents of an item have changed.
| Parameters | |
|---|---|
oldItem: Value |
The item in the old list. |
newItem: Value |
The item in the new list. |
| Returns | |
|---|---|
Boolean |
True if the contents of the items are the same or false if they are different. |
| See also | |
|---|---|
areContentsTheSame |
areItemsTheSame
abstract fun areItemsTheSame(oldItem: Value, newItem: Value): Boolean
Called to decide whether two objects represent the same item.
| Parameters | |
|---|---|
oldItem: Value |
The item in the old list. |
newItem: Value |
The item in the new list. |
| Returns | |
|---|---|
Boolean |
True if the two items represent the same object or false if they are different. |
| See also | |
|---|---|
areItemsTheSame |
getChangePayload
fun getChangePayload(oldItem: Value, newItem: Value): Any?
Called to get a change payload between an old and new version of an item.
| See also | |
|---|---|
getChangePayload |