ItemSnapshotList
class ItemSnapshotList<T> : AbstractList<T?>
kotlin.Any | |||
↳ | kotlin.collections.AbstractCollection<E> | ||
↳ | kotlin.collections.AbstractList<T> | ||
↳ | androidx.paging.ItemSnapshotList |
Snapshot of data being presented by a AsyncPagingDataDiffer or a PagingDataAdapter.
Summary
Public constructors | |
---|---|
Snapshot of data being presented by a AsyncPagingDataDiffer or a PagingDataAdapter. |
Public methods | |
---|---|
T? |
Returns the item at index, where index includes the position of placeholders. |
Inherited extension functions | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From androidx.compose.ui.util.kotlin.collections.List
|
||||||||||||||||||
From androidx.compose.runtime.kotlin.collections.Collection
|
||||||||||||||||||
From androidx.compose.runtime.kotlin.collections.Iterable
|
Properties | |
---|---|
List<T> |
The presented data, excluding placeholders. |
Int |
Number of placeholders after the presented items, 0 if
enablePlaceholders is |
Int |
Number of placeholders before the presented items, 0 if
enablePlaceholders is |
Int |
Size of ItemSnapshotList including placeholders. |
Public constructors
<init>
ItemSnapshotList(
@IntRange(0) placeholdersBefore: Int,
@IntRange(0) placeholdersAfter: Int,
items: List<T>)
Snapshot of data being presented by a AsyncPagingDataDiffer or a PagingDataAdapter.
Public methods
get
fun get(index: Int): T?
Returns the item at index, where index includes the position of placeholders. If index
points to the position of a placeholder, null
is returned.
To get the size using an index excluding placeholders, use List.size on items directly.
Exceptions | |
---|---|
IndexOutOfBoundsException |
if index < 0 or index > size. |
Properties
placeholdersAfter
val placeholdersAfter: Int
Number of placeholders after the presented items, 0 if
enablePlaceholders is false
.
placeholdersBefore
val placeholdersBefore: Int
Number of placeholders before the presented items, 0 if
enablePlaceholders is false
.
size
val size: Int
Size of ItemSnapshotList including placeholders.
To get the size excluding placeholders, use List.size on items directly.
See Also