TransformingLazyColumnState

class TransformingLazyColumnState : ScrollableState


A state object that can be hoisted to control and observe scrolling.

In most cases, this will be created via rememberTransformingLazyColumnState.

Summary

Public constructors

Public functions

open Float
open suspend Unit
scroll(scrollPriority: MutatePriority, block: suspend ScrollScope.() -> Unit)
suspend Unit
scrollToItem(index: @IntRange(from = 0) Int, scrollOffset: Int)

Scrolls the item specified by index to the center of the screen.

Public properties

open Boolean
open Boolean
open Boolean
TransformingLazyColumnLayoutInfo

The object of LazyColumnLayoutInfo calculated during the last layout pass.

Public constructors

TransformingLazyColumnState

Added in 1.5.0-alpha04
TransformingLazyColumnState()

Public functions

dispatchRawDelta

Added in 1.5.0-alpha04
open fun dispatchRawDelta(delta: Float): Float

scroll

Added in 1.5.0-alpha04
open suspend fun scroll(scrollPriority: MutatePriority, block: suspend ScrollScope.() -> Unit): Unit

scrollToItem

Added in 1.5.0-alpha04
suspend fun scrollToItem(index: @IntRange(from = 0) Int, scrollOffset: Int = 0): Unit

Scrolls the item specified by index to the center of the screen.

This operation happens instantly without animation.

Parameters
index: @IntRange(from = 0) Int

The index of the item to scroll to. Must be non-negative.

scrollOffset: Int = 0

The offset between the center of the screen and item's center.

Public properties

canScrollBackward

open val canScrollBackwardBoolean

canScrollForward

open val canScrollForwardBoolean

isScrollInProgress

Added in 1.5.0-alpha04
open val isScrollInProgressBoolean

layoutInfo

Added in 1.5.0-alpha04
val layoutInfoTransformingLazyColumnLayoutInfo

The object of LazyColumnLayoutInfo calculated during the last layout pass. For example, you can use it to calculate what items are currently visible. Note that this property is observable and is updated after every scroll or remeasure. If you use it in the composable function it will be recomposed on every change causing potential performance issues including infinity recomposition loop. Therefore, avoid using it in the composition. If you want to run some side effects like sending an analytics event or updating a state based on this value consider using "snapshotFlow":