rememberScrollable2DState
Functions summary
Scrollable2DState |
@ComposableCreate and remember the default implementation of |
Cmn
|
Functions
rememberScrollable2DState
@Composable
fun rememberScrollable2DState(consumeScrollDelta: (Offset) -> Offset): Scrollable2DState
Create and remember the default implementation of Scrollable2DState interface that contains necessary information about the ongoing fling and provides smooth scrolling capabilities.
This is the simplest way to set up a scrollable2D modifier. When constructing this Scrollable2DState, you must provide a consumeScrollDelta lambda, which will be invoked whenever scroll happens (by gesture input, by smooth scrolling, by flinging or nested scroll) with the delta in pixels. The amount of scrolling delta consumed must be returned from this lambda to ensure proper nested scrolling behaviour.