{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public final class ItemSnapshotList<T extends Object>
Snapshot of data being presented by a androidx.pagingAsyncPagingDataDiffer or a PagingDataAdapter
.
Public fields |
|
---|---|
final @NonNull List<@NonNull T> |
The presented data, excluding placeholders. |
final int |
Number of placeholders after the presented |
final int |
Number of placeholders before the presented |
int |
Size of |
Public constructors |
|
---|---|
Public methods |
|
---|---|
@Nullable T |
get(int index) Returns the item at |
Inherited methods |
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||
|
||||||||||||||||
@NonNull
public final @NonNull List<@NonNull T> items
The presented data, excluding placeholders.
@NonNull
public final int placeholdersAfter
Number of placeholders after the presented items
, 0 if enablePlaceholders
is false
.
@NonNull
public final int placeholdersBefore
Number of placeholders before the presented items
, 0 if enablePlaceholders
is false
.
@NonNull
public int size
Size of ItemSnapshotList
including placeholders.
To get the size excluding placeholders, use List.size
on items
directly.
See also | |
---|---|
items |
@NonNull
public final <T extends Object> ItemSnapshotList(
@IntRange int placeholdersBefore,
@IntRange int placeholdersAfter,
@NonNull List<@NonNull T> items
)