ItemSnapshotList



Snapshot of data being presented by a androidx.pagingAsyncPagingDataDiffer or a androidx.paging.PagingDataAdapter.

Summary

Public constructors

<T : Any?> ItemSnapshotList(
    placeholdersBefore: @IntRange(from = 0) Int,
    placeholdersAfter: @IntRange(from = 0) Int,
    items: List<T>
)
Cmn

Public functions

open operator T?
get(index: Int)

Returns the item at index, where index includes the position of placeholders.

Cmn

Public properties

List<T>

The presented data, excluding placeholders.

Cmn
Int

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

Cmn
Int

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

Cmn
open Int

Size of ItemSnapshotList including placeholders.

Cmn

Inherited functions

From kotlin.collections.AbstractCollection
open operator Boolean
contains(element: T?)
Cmn
open Boolean
containsAll(elements: Collection<T?>)
Cmn
open Boolean
Cmn
open Array<Any?>
Cmn
open Array<T>
<T : Any?> toArray(array: Array<T>)
Cmn
open String
Cmn
From kotlin.collections.AbstractList
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open Int
indexOf(element: T?)
Cmn
open operator Iterator<T?>
Cmn
open Int
lastIndexOf(element: T?)
Cmn
open ListIterator<T?>
Cmn
open ListIterator<T?>
listIterator(index: Int)
Cmn
open List<T?>
subList(fromIndex: Int, toIndex: Int)
Cmn

Public constructors

ItemSnapshotList

<T : Any?> ItemSnapshotList(
    placeholdersBefore: @IntRange(from = 0) Int,
    placeholdersAfter: @IntRange(from = 0) Int,
    items: List<T>
)

Public functions

get

open operator 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.

Public properties

items

val itemsList<T>

The presented data, excluding placeholders.

placeholdersAfter

val placeholdersAfterInt

Number of placeholders after the presented items, 0 if enablePlaceholders is false.

placeholdersBefore

val placeholdersBeforeInt

Number of placeholders before the presented items, 0 if enablePlaceholders is false.

size

open val sizeInt

Size of ItemSnapshotList including placeholders.

To get the size excluding placeholders, use List.size on items directly.

See also
items