LazyLayoutItemProvider


Provides all the needed info about the items which could be later composed and displayed as children or LazyLayout.

Note: this interface 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

Public functions

Unit
@Composable
Item(index: Int, key: Any)

The item for the given index and key.

Cmn
open Any?

Returns the content type for the item on this index.

Cmn
open Int
getIndex(key: Any)

Get index for given key.

Cmn
open Any
getKey(index: Int)

Returns the key for the item on this index.

Cmn

Public properties

Int

The total number of items in the lazy layout (visible or not).

Cmn

Public functions

Item

@Composable
fun Item(index: Int, key: Any): Unit

The item for the given index and key.

getContentType

open fun getContentType(index: Int): Any?

Returns the content type for the item on this index. It is used to improve the item compositions reusing efficiency. Note that null is a valid type and items of such type will be considered compatible.

getIndex

open fun getIndex(key: Any): Int

Get index for given key. The index is not guaranteed to be known for all keys in layout for optimization purposes, but must be present for elements in current viewport. If the key is not present in the layout or near current viewport, return -1.

getKey

open fun getKey(index: Int): Any

Returns the key for the item on this index.

See also
getDefaultLazyLayoutKey

which you can use if the user didn't provide a key.

Public properties

itemCount

val itemCountInt

The total number of items in the lazy layout (visible or not).