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

LazyGridItemInfo

public sealed interface LazyGridItemInfo


Contains useful information about an individual item in lazy grids like LazyVerticalGrid.

See also
LazyGridLayoutInfo

Summary

Constants

default static final int

Possible value for column, when they are unknown.

default static final int

Possible value for row, when they are unknown.

Public methods

abstract int

The column occupied by the top start point of the item.

abstract Object

The content type of the item which was passed to the item() or items() function.

abstract int

The index of the item in the grid.

abstract @NonNull Object

The key of the item which was passed to the item() or items() function.

abstract @NonNull IntOffset

The offset of the item in pixels.

abstract int

The row occupied by the top start point of the item.

abstract @NonNull IntSize

The pixel size of the item.

Constants

UnknownColumn

default static final int UnknownColumn

Possible value for column, when they are unknown. This can happen when the item is visible while animating to exit the viewport.

UnknownRow

default static final int UnknownRow

Possible value for row, when they are unknown. This can happen when the item is visible while animating to exit the viewport.

Public methods

getColumn

abstract int getColumn()

The column occupied by the top start point of the item. If this is unknown, for example while this item is animating to exit the viewport and is still visible, the value will be UnknownColumn.

getContentType

abstract Object getContentType()

The content type of the item which was passed to the item() or items() function.

getIndex

abstract int getIndex()

The index of the item in the grid.

getKey

abstract @NonNull Object getKey()

The key of the item which was passed to the item() or items() function.

getOffset

abstract @NonNull IntOffset getOffset()

The offset of the item in pixels. It is relative to the top start of the lazy grid container.

getRow

abstract int getRow()

The row occupied by the top start point of the item. If this is unknown, for example while this item is animating to exit the viewport and is still visible, the value will be UnknownRow.

getSize

abstract @NonNull IntSize getSize()

The pixel size of the item. Note that if you emit multiple layouts in the composable slot for the item then this size will be calculated as the max of their sizes.