androidx.glance.appwidget.lazy

Interfaces

LazyItemScope

Receiver scope being used by the item content parameter of LazyColumn.

LazyListScope

Receiver scope which is used by LazyColumn.

LazyVerticalGridScope

Receiver scope which is used by LazyColumn.

Classes

GridCells

Defines the number of columns of the GridView.

GridCells.Adaptive

Defines a grid with as many columns as possible on the condition that every cell has at least minSize space and all extra space distributed evenly.

GridCells.Fixed

Defines a fixed number of columns, limited to 1 through 5.

Annotations

Composables

LazyColumn

A vertical scrolling list that only lays out the currently visible items.

LazyVerticalGrid

The DSL implementation of a lazy grid layout.

Extension functions summary

inline Unit
<T : Any?> LazyListScope.items(
    items: Array<T>,
    noinline itemId: (item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
)

Adds an array of items.

inline Unit
<T : Any?> LazyVerticalGridScope.items(
    items: Array<T>,
    noinline itemId: (item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
)

Adds an array of items.

inline Unit
<T : Any?> LazyListScope.items(
    items: List<T>,
    crossinline itemId: (item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
)

Adds a list of items.

inline Unit
<T : Any?> LazyVerticalGridScope.items(
    items: List<T>,
    crossinline itemId: (item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
)

Adds a list of items.

inline Unit
<T : Any?> LazyListScope.itemsIndexed(
    items: Array<T>,
    noinline itemId: (index: Int, item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
)

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

inline Unit
<T : Any?> LazyVerticalGridScope.itemsIndexed(
    items: Array<T>,
    noinline itemId: (index: Int, item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
)

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

inline Unit
<T : Any?> LazyListScope.itemsIndexed(
    items: List<T>,
    crossinline itemId: (index: Int, item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
)

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

inline Unit
<T : Any?> LazyVerticalGridScope.itemsIndexed(
    items: List<T>,
    crossinline itemId: (index: Int, item) -> Long,
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
)

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

Extension functions

LazyListScope.items

inline fun <T : Any?> LazyListScope.items(
    items: Array<T>,
    noinline itemId: (item) -> Long = { LazyListScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
): Unit

Adds an array of items.

Parameters
items: Array<T>

the data array

noinline itemId: (item) -> Long = { LazyListScope.UnspecifiedItemId }

a factory of stable and unique list item ids. Using the same itemId for multiple items in the array is not allowed. When you specify the itemId, the scroll position will be maintained based on the itemId, which means if you add/remove items before the current visible item the item with the given itemId will be kept as the first visible one.

crossinline itemContent: @Composable LazyItemScope.(item) -> Unit

the content displayed by a single item

LazyVerticalGridScope.items

inline fun <T : Any?> LazyVerticalGridScope.items(
    items: Array<T>,
    noinline itemId: (item) -> Long = { LazyVerticalGridScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
): Unit

Adds an array of items.

Parameters
items: Array<T>

the data array

noinline itemId: (item) -> Long = { LazyVerticalGridScope.UnspecifiedItemId }

a factory of stable and unique list item ids. Using the same itemId for multiple items in the array is not allowed. When you specify the itemId, the scroll position will be maintained based on the itemId, which means if you add/remove items before the current visible item the item with the given itemId will be kept as the first visible one.

crossinline itemContent: @Composable LazyItemScope.(item) -> Unit

the content displayed by a single item

LazyListScope.items

inline fun <T : Any?> LazyListScope.items(
    items: List<T>,
    crossinline itemId: (item) -> Long = { LazyListScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
): Unit

Adds a list of items.

Parameters
items: List<T>

the data list

crossinline itemId: (item) -> Long = { LazyListScope.UnspecifiedItemId }

a factory of stable and unique ids representing the item. The value may not be less than or equal to -2^62, as these values are reserved by the Glance API. Specifying the list item ids will maintain the scroll position through app widget updates in Android S and higher devices.

crossinline itemContent: @Composable LazyItemScope.(item) -> Unit

the content displayed by a single item

LazyVerticalGridScope.items

inline fun <T : Any?> LazyVerticalGridScope.items(
    items: List<T>,
    crossinline itemId: (item) -> Long = { LazyVerticalGridScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(item) -> Unit
): Unit

Adds a list of items.

Parameters
items: List<T>

the data list

crossinline itemId: (item) -> Long = { LazyVerticalGridScope.UnspecifiedItemId }

a factory of stable and unique ids representing the item. The value may not be less than or equal to -2^62, as these values are reserved by the Glance API. Specifying the list item ids will maintain the scroll position through app widget updates in Android S and higher devices.

crossinline itemContent: @Composable LazyItemScope.(item) -> Unit

the content displayed by a single item

LazyListScope.itemsIndexed

inline fun <T : Any?> LazyListScope.itemsIndexed(
    items: Array<T>,
    noinline itemId: (index: Int, item) -> Long = { _, _ -> LazyListScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
): Unit

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

Parameters
items: Array<T>

the data array

noinline itemId: (index: Int, item) -> Long = { _, _ -> LazyListScope.UnspecifiedItemId }

a factory of stable and unique list item ids. Using the same itemId for multiple items in the array is not allowed. When you specify the itemId the scroll position will be maintained based on the itemId, which means if you add/remove items before the current visible item the item with the given itemId will be kept as the first visible one.

crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit

the content displayed by a single item

LazyVerticalGridScope.itemsIndexed

inline fun <T : Any?> LazyVerticalGridScope.itemsIndexed(
    items: Array<T>,
    noinline itemId: (index: Int, item) -> Long = { _, _ -> LazyVerticalGridScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
): Unit

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

Parameters
items: Array<T>

the data array

noinline itemId: (index: Int, item) -> Long = { _, _ -> LazyVerticalGridScope.UnspecifiedItemId }

a factory of stable and unique list item ids. Using the same itemId for multiple items in the array is not allowed. When you specify the itemId the scroll position will be maintained based on the itemId, which means if you add/remove items before the current visible item the item with the given itemId will be kept as the first visible one.

crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit

the content displayed by a single item

LazyListScope.itemsIndexed

inline fun <T : Any?> LazyListScope.itemsIndexed(
    items: List<T>,
    crossinline itemId: (index: Int, item) -> Long = { _, _ -> LazyListScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
): Unit

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

Parameters
items: List<T>

the data list

crossinline itemId: (index: Int, item) -> Long = { _, _ -> LazyListScope.UnspecifiedItemId }

a factory of stable and unique ids representing the item. The value may not be less than or equal to -2^62, as these values are reserved by the Glance API. Specifying the list item ids will maintain the scroll position through app widget updates in Android S and higher devices.

crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit

the content displayed by a single item

LazyVerticalGridScope.itemsIndexed

inline fun <T : Any?> LazyVerticalGridScope.itemsIndexed(
    items: List<T>,
    crossinline itemId: (index: Int, item) -> Long = { _, _ -> LazyVerticalGridScope.UnspecifiedItemId },
    crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit
): Unit

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

Parameters
items: List<T>

the data list

crossinline itemId: (index: Int, item) -> Long = { _, _ -> LazyVerticalGridScope.UnspecifiedItemId }

a factory of stable and unique ids representing the item. The value may not be less than or equal to -2^62, as these values are reserved by the Glance API. Specifying the list item ids will maintain the scroll position through app widget updates in Android S and higher devices.

crossinline itemContent: @Composable LazyItemScope.(index: Int, item) -> Unit

the content displayed by a single item