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

LazyListItemInfo

public interface LazyListItemInfo


Contains useful information about an individual item in lazy lists like LazyColumn or LazyRow.

See also
LazyListLayoutInfo

Summary

Public methods

default 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 list.

abstract @NonNull Object

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

abstract int

The main axis offset of the item in pixels.

abstract int

The main axis size of the item in pixels.

Public methods

getContentType

default 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 list.

getKey

abstract @NonNull Object getKey()

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

getOffset

abstract int getOffset()

The main axis offset of the item in pixels. It is relative to the start of the lazy list container.

getSize

abstract int getSize()

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