DiffUtil.ItemCallback instead.@Deprecated
public static interface DiffObservableList.Callback<T>
| Modifier and Type | Method and Description |
|---|---|
boolean |
areContentsTheSame(T oldItem,
T newItem)
Deprecated.
Called by the DiffUtil when it wants to check whether two items have the same data.
|
boolean |
areItemsTheSame(T oldItem,
T newItem)
Deprecated.
Called by the DiffUtil to decide whether two object represent the same Item.
|
boolean areItemsTheSame(T oldItem, T newItem)
For example, if your items have unique ids, this method should check their id equality.
oldItem - The old item.newItem - The new item.boolean areContentsTheSame(T oldItem, T newItem)
DiffUtil uses this method to check equality instead of Object.equals(Object) so
that you can change its behavior depending on your UI.
This method is called only if #areItemsTheSame(T, T) returns true for
these items.
oldItem - The old item.newItem - The new item which replaces the old item.