-
- All Implemented Interfaces:
public abstract class DiffCallback<Value extends Object>Callback that informs ArrayAnyAdapter how to compute list updates when using android.support.v7.util.DiffUtil in ArrayAnyAdapter.setItems method.
The ArrayAnyAdapter.setItems method will pass items from different lists to this callback in order to implement the android.support.v7.util.DiffUtil.Callback it uses to compute differences between lists.
-
-
Constructor Summary
Constructors Constructor Description DiffCallback()
-
Method Summary
Modifier and Type Method Description abstract BooleanareItemsTheSame(Value oldItem, Value newItem)Called to decide whether two objects represent the same item. abstract BooleanareContentsTheSame(Value oldItem, Value newItem)Called to decide whether two items have the same data. ObjectgetChangePayload(Value oldItem, Value newItem)Called to get a change payload between an old and new version of an item. -
-
Method Detail
-
areItemsTheSame
abstract Boolean areItemsTheSame(Value oldItem, Value newItem)
Called to decide whether two objects represent the same item.
- Parameters:
oldItem- The item in the old list.newItem- The item in the new list.
-
areContentsTheSame
abstract Boolean areContentsTheSame(Value oldItem, Value newItem)
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- The item in the old list.newItem- The item in the new list.
-
getChangePayload
Object getChangePayload(Value oldItem, Value newItem)
Called to get a change payload between an old and new version of an item.
-
-
-
-