LazyLayoutIntervalContent


Common parts backing the interval-based content of lazy layout defined through item DSL.

Note: this class is a part of LazyLayout harness that allows for building custom lazy layouts. LazyLayout and all corresponding APIs are still under development and are subject to change.

Summary

Nested types

Common content of individual intervals in item DSL of lazy layouts.

Public constructors

LazyLayoutIntervalContent.Interval> LazyLayoutIntervalContent()
Cmn

Public functions

Any?

Returns content type based on a global index.

Cmn
Any
getKey(index: Int)

Returns item key based on a global index.

Cmn
inline T
Any?> withInterval(
    globalIndex: Int,
    block: (localIntervalIndex: Int, content) -> T
)

Runs a block on the content of the interval associated with the provided globalIndex with providing a local index in the given interval.

Cmn

Public properties

abstract IntervalList
Cmn
Int

The total amount of items in all the intervals.

Cmn

Public constructors

LazyLayoutIntervalContent

LazyLayoutIntervalContent.Interval> LazyLayoutIntervalContent()

Public functions

getContentType

fun getContentType(index: Int): Any?

Returns content type based on a global index.

getKey

fun getKey(index: Int): Any

Returns item key based on a global index.

withInterval

inline fun Any?> withInterval(
    globalIndex: Int,
    block: (localIntervalIndex: Int, content) -> T
): T

Runs a block on the content of the interval associated with the provided globalIndex with providing a local index in the given interval.

Public properties

intervals

abstract val intervalsIntervalList

itemCount

val itemCountInt

The total amount of items in all the intervals.