Class

LazyLayoutIntervalContent

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

Source set: Common
public abstract class LazyLayoutIntervalContent<Interval : LazyLayoutIntervalContent.Interval>

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.

Properties

intervals

Source set: Common
public abstract val intervals: IntervalList<Interval>

itemCount

Source set: Common
public val itemCount: Int

The total amount of items in all the intervals.

Functions

getKey

Source set: Common
public fun getKey(index: Int): Any

Returns item key based on a global index.

getContentType

Source set: Common
public fun getContentType(index: Int): Any?

Returns content type based on a global index.

withInterval

Source set: Common
public inline fun <T> withInterval(
        globalIndex: Int,
        block: (localIntervalIndex: Int, content: Interval) -> 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.

Members

Interval

Source set: Common
public interface Interval

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

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.

Properties

key

Source set: Common
public val key: ((index: Int) -> Any)?

Returns item key based on a local index for the current interval.

type

Source set: Common
public val type: ((index: Int) -> Any?)

Returns item type based on a local index for the current interval.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: