rememberSnapFlingBehavior

Composable Function

Common
@Composable
fun rememberSnapFlingBehavior(
    lazyListState: LazyListState,
    snapPosition: SnapPosition = SnapPosition.Center,
): FlingBehavior

Create and remember a FlingBehavior for decayed snapping in Lazy Lists. This will snap the item according to snapPosition.

Parameters

lazyListStateThe LazyListState from the LazyList where this FlingBehavior will be used.
snapPositionThe desired positioning of the snapped item within the main layout. This position should be considered with regards to the start edge of the item and the placement within the viewport.
Common
@Composable
fun rememberSnapFlingBehavior(
    snapLayoutInfoProvider: SnapLayoutInfoProvider
): TargetedFlingBehavior

Creates and remember a FlingBehavior that performs snapping.

Parameters

snapLayoutInfoProviderThe information about the layout that will do snapping
Common
@Composable
fun rememberSnapFlingBehavior(
    lazyGridState: LazyGridState,
    snapPosition: SnapPosition = SnapPosition.Center,
): FlingBehavior

Create and remember a FlingBehavior for decayed snapping in Lazy Grids. This will snap the item according to snapPosition.

Parameters

lazyGridStateThe LazyGridState from the LazyGrid where this FlingBehavior will be used.
snapPositionThe desired positioning of the snapped item within the main layout. This position should be considered with regards to the start edge of the item and the placement within the viewport.