LazyListLayoutInfo
-
Cmn
interface LazyListLayoutInfo
Contains useful information about the currently displayed layout state of lazy lists like LazyColumn or LazyRow. For example you can get the list of currently displayed item.
Use LazyListState.layoutInfo to retrieve this
Summary
Public properties |
||
|---|---|---|
open Int |
The content padding in pixels applied after the last item in the direction of scrolling. |
Cmn
|
open Int |
The content padding in pixels applied before the first item in the direction of scrolling. |
Cmn
|
open Int |
The spacing between items in the direction of scrolling. |
Cmn
|
open Orientation |
The orientation of the lazy list. |
Cmn
|
open Boolean |
True if the direction of scrolling and layout is reversed. |
Cmn
|
Int |
The total count of items passed to |
Cmn
|
Int |
The end offset of the layout's viewport in pixels. |
Cmn
|
open IntSize |
The size of the viewport in pixels. |
Cmn
|
Int |
The start offset of the layout's viewport in pixels. |
Cmn
|
List<LazyListItemInfo> |
The list of |
Cmn
|
Public properties
afterContentPadding
open val afterContentPadding: Int
The content padding in pixels applied after the last item in the direction of scrolling. For example it is a bottom content padding for LazyColumn with reverseLayout set to false.
beforeContentPadding
open val beforeContentPadding: Int
The content padding in pixels applied before the first item in the direction of scrolling. For example it is a top content padding for LazyColumn with reverseLayout set to false.
mainAxisItemSpacing
open val mainAxisItemSpacing: Int
The spacing between items in the direction of scrolling.
reverseLayout
open val reverseLayout: Boolean
True if the direction of scrolling and layout is reversed.
viewportEndOffset
val viewportEndOffset: Int
The end offset of the layout's viewport in pixels. You can think of it as a maximum offset which would be visible. It is the size of the lazy list layout minus beforeContentPadding.
You can use it to understand what items from visibleItemsInfo are fully visible.
viewportSize
open val viewportSize: IntSize
The size of the viewport in pixels. It is the lazy list layout size including all the content paddings.
viewportStartOffset
val viewportStartOffset: Int
The start offset of the layout's viewport in pixels. You can think of it as a minimum offset which would be visible. Usually it is 0, but it can be negative if non-zero beforeContentPadding was applied as the content displayed in the content padding area is still visible.
You can use it to understand what items from visibleItemsInfo are fully visible.
visibleItemsInfo
val visibleItemsInfo: List<LazyListItemInfo>
The list of LazyListItemInfo representing all the currently visible items.