{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LazyLayoutIntervalContent

@ExperimentalFoundationApi
public abstract class LazyLayoutIntervalContent<Interval extends LazyLayoutIntervalContent.Interval>


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

Summary

Nested types

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

Public constructors

Public methods

final Object
getContentType(int index)

Returns content type based on a global index.

abstract @NonNull IntervalList<@NonNull Interval>
final int

The total amount of items in all the intervals.

final @NonNull Object
getKey(int index)

Returns item key based on a global index.

final @NonNull T
<T extends Object> withInterval(
    int globalIndex,
    @NonNull Function2<@NonNull Integer, @NonNull content, @NonNull T> block
)

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

Public constructors

LazyLayoutIntervalContent

public <Interval extends LazyLayoutIntervalContent.Interval> LazyLayoutIntervalContent()

Public methods

getContentType

public final Object getContentType(int index)

Returns content type based on a global index.

getIntervals

public abstract @NonNull IntervalList<@NonNull Interval> getIntervals()

getItemCount

public final int getItemCount()

The total amount of items in all the intervals.

getKey

public final @NonNull Object getKey(int index)

Returns item key based on a global index.

withInterval

public final @NonNull T <T extends Object> withInterval(
    int globalIndex,
    @NonNull Function2<@NonNull Integer, @NonNull content, @NonNull T> block
)

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