SortedListAdapterCallback
public
abstract
class
SortedListAdapterCallback
extends Callback<T2>
A SortedList.Callback
implementation that can bind a SortedList
to a
RecyclerView.Adapter
.
Summary
Public methods |
void
|
onChanged(int position, int count, Object payload)
Called when count number of items are updated at the given position.
|
void
|
onChanged(int position, int count)
Called by the SortedList when the item at the given position is updated.
|
void
|
onInserted(int position, int count)
|
void
|
onMoved(int fromPosition, int toPosition)
|
void
|
onRemoved(int position, int count)
|
Inherited methods |
From class
androidx.recyclerview.widget.SortedList.Callback
abstract
boolean
|
areContentsTheSame(T2 oldItem, T2 newItem)
Called by the SortedList when it wants to check whether two items have the same data
or not.
|
abstract
boolean
|
areItemsTheSame(T2 item1, T2 item2)
Called by the SortedList to decide whether two objects represent the same Item or not.
|
abstract
int
|
compare(T2 o1, T2 o2)
Similar to Comparator.compare(Object, Object) , should compare two and
return how they should be ordered.
|
Object
|
getChangePayload(T2 item1, T2 item2)
When areItemsTheSame(T2, T2) returns true for two items and
areContentsTheSame(T2, T2) returns false for them, SortedList.Callback calls this
method to get a payload about the change.
|
void
|
onChanged(int position, int count, Object payload)
Called when count number of items are updated at the given position.
|
abstract
void
|
onChanged(int position, int count)
Called by the SortedList when the item at the given position is updated.
|
|
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()
|
|
From interface
java.util.Comparator
abstract
int
|
compare(T2 arg0, T2 arg1)
|
static
<T, U>
Comparator<T2>
|
comparing(Function<? super T, ? extends U> arg0, Comparator<? super U> arg1)
|
static
<T, U extends Comparable<? super U>>
Comparator<T2>
|
comparing(Function<? super T, ? extends U> arg0)
|
static
<T>
Comparator<T2>
|
comparingDouble(ToDoubleFunction<? super T> arg0)
|
static
<T>
Comparator<T2>
|
comparingInt(ToIntFunction<? super T> arg0)
|
static
<T>
Comparator<T2>
|
comparingLong(ToLongFunction<? super T> arg0)
|
abstract
boolean
|
equals(Object arg0)
|
static
<T extends Comparable<? super T>>
Comparator<T>
|
naturalOrder()
|
static
<T>
Comparator<T2>
|
nullsFirst(Comparator<? super T> arg0)
|
static
<T>
Comparator<T2>
|
nullsLast(Comparator<? super T> arg0)
|
static
<T extends Comparable<? super T>>
Comparator<T>
|
reverseOrder()
|
default
Comparator<T2>
|
reversed()
|
default
<U extends Comparable<? super U>>
Comparator<T2>
|
thenComparing(Function<? super T, ? extends U> arg0)
|
default
<U>
Comparator<T2>
|
thenComparing(Function<? super T, ? extends U> arg0, Comparator<? super U> arg1)
|
default
Comparator<T2>
|
thenComparing(Comparator<? super T> arg0)
|
default
Comparator<T2>
|
thenComparingDouble(ToDoubleFunction<? super T> arg0)
|
default
Comparator<T2>
|
thenComparingInt(ToIntFunction<? super T> arg0)
|
default
Comparator<T2>
|
thenComparingLong(ToLongFunction<? super T> arg0)
|
|
From interface
androidx.recyclerview.widget.ListUpdateCallback
abstract
void
|
onChanged(int position, int count, Object payload)
Called when count number of items are updated at the given position.
|
abstract
void
|
onInserted(int position, int count)
Called when count number of items are inserted at the given position.
|
abstract
void
|
onMoved(int fromPosition, int toPosition)
Called when an item changes its position in the list.
|
abstract
void
|
onRemoved(int position, int count)
Called when count number of items are removed from the given position.
|
|
Public constructors
public SortedListAdapterCallback (Adapter adapter)
Creates a SortedList.Callback
that will forward data change events to the provided
Adapter.
Parameters |
adapter |
Adapter : The Adapter instance which should receive events from the SortedList.
|
Public methods
onChanged
public void onChanged (int position,
int count,
Object payload)
Called when count
number of items are updated at the given position.
Parameters |
position |
int : The position of the item which has been updated. |
count |
int : The number of items which has changed.
|
payload |
Object |
onChanged
public void onChanged (int position,
int count)
Called by the SortedList when the item at the given position is updated.
Parameters |
position |
int : The position of the item which has been updated. |
count |
int : The number of items which has changed.
|
onInserted
public void onInserted (int position,
int count)
Parameters |
position |
int |
count |
int |
onMoved
public void onMoved (int fromPosition,
int toPosition)
Parameters |
fromPosition |
int |
toPosition |
int |
onRemoved
public void onRemoved (int position,
int count)
Parameters |
position |
int |
count |
int |