Android 12 Developer Preview is here! Try it out, and give us your feedback!

LazyGridScope

interface LazyGridScope
androidx.compose.foundation.lazy.LazyGridScope

Receiver scope which is used by LazyVerticalGrid.

Summary

Public methods
abstract Unit
item(content: LazyItemScope.() -> Unit)

Adds a single item to the scope.

abstract Unit
items(count: Int, itemContent: LazyItemScope.(index: Int) -> Unit)

Adds a count of items.

Extension functions
From androidx.compose.foundation.lazy
Unit
LazyGridScope.items(items: List<T>, crossinline itemContent: LazyItemScope.(item: T) -> Unit)

Adds a list of items.

Unit
LazyGridScope.items(items: Array<T>, crossinline itemContent: LazyItemScope.(item: T) -> Unit)

Adds an array of items.

Unit
LazyGridScope.itemsIndexed(items: List<T>, crossinline itemContent: LazyItemScope.(index: Int, item: T) -> Unit)

Adds a list of items where the content of an item is aware of its index.

Unit
LazyGridScope.itemsIndexed(items: Array<T>, crossinline itemContent: LazyItemScope.(index: Int, item: T) -> Unit)

Adds an array of items where the content of an item is aware of its index.

Public methods

item

abstract fun item(content: LazyItemScope.() -> Unit): Unit

Adds a single item to the scope.

Parameters
content: LazyItemScope.() -> Unit the content of the item

items

abstract fun items(
    count: Int,
    itemContent: LazyItemScope.(index: Int) -> Unit
): Unit

Adds a count of items.

Parameters
count: Int the items count
itemContent: LazyItemScope.(index: Int) -> Unit the content displayed by a single item