Stay organized with collections
Save and categorize content based on your preferences.
added in
version 22.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1
SortedListAdapterCallback
This package is part of the
Android support library which
is no longer maintained.
The support library has been superseded by AndroidX
which is part of Jetpack .
We recommend using the AndroidX libraries in all new projects. You should also consider
migrating existing projects to AndroidX.
To find the AndroidX class that maps to this deprecated class, see the AndroidX
support library class
mappings .
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
android.support.v7.util.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 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
android.support.v7.util.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
SortedListAdapterCallback
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
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
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
void onInserted (int position,
int count)
Parameters
position
int
count
int
onMoved
void onMoved (int fromPosition,
int toPosition)
Parameters
fromPosition
int
toPosition
int
onRemoved
void onRemoved (int position,
int count)
Parameters
position
int
count
int
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]