DiffCallback
public
abstract
class
DiffCallback
extends Object
java.lang.Object
|
↳ |
androidx.leanback.widget.DiffCallback<Value>
|
Callback that informs ArrayObjectAdapter
how to compute list updates when using
DiffUtil
in ArrayObjectAdapter.setItems(List, DiffCallback)
method.
The ArrayObjectAdapter.setItems(List, DiffCallback)
method will pass items from different
lists to this callback in order to implement
the DiffUtil.Callback
it uses to compute differences between
lists.
Summary
Public methods |
abstract
boolean
|
areContentsTheSame(Value oldItem, Value newItem)
Called to decide whether two items have the same data.
|
abstract
boolean
|
areItemsTheSame(Value oldItem, Value newItem)
Called to decide whether two objects represent the same item.
|
Object
|
getChangePayload(Value oldItem, Value newItem)
Called to get a change payload between an old and new version of an item.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
DiffCallback
public DiffCallback ()
Public methods
areContentsTheSame
public 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 |
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. |
areItemsTheSame
public abstract boolean areItemsTheSame (Value oldItem,
Value newItem)
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. |
getChangePayload
public Object getChangePayload (Value oldItem,
Value newItem)
Called to get a change payload between an old and new version of an item.
Parameters |
oldItem |
Value |
newItem |
Value |