flingBehavior

fun flingBehavior(    state: PagerState,     decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),     snapAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec,     maximumFlingDistance: (SnapperLayoutInfo) -> Float = singlePageFlingDistance,     endContentPadding: Dp = 0.dp): FlingBehavior

Remember the default FlingBehavior that represents the scroll curve.

Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

Parameters

state

The PagerState to update.

decayAnimationSpec

The decay animation spec to use for decayed flings.

snapAnimationSpec

The animation spec to use when snapping.

maximumFlingDistance

Block which returns the maximum fling distance in pixels.

endContentPadding

The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).


fun flingBehavior(    state: PagerState,     decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),     snapAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec,     endContentPadding: Dp = 0.dp,     snapIndex: (SnapperLayoutInfo, startIndex: Int, targetIndex: Int) -> Int): FlingBehavior

Remember the default FlingBehavior that represents the scroll curve.

Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

Parameters

state

The PagerState to update.

decayAnimationSpec

The decay animation spec to use for decayed flings.

snapAnimationSpec

The animation spec to use when snapping.

endContentPadding

The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).

snapIndex

Block which returns the index to snap to. The block is provided with the SnapperLayoutInfo, the index where the fling started, and the index which Snapper has determined is the correct target index. Callers can override this value to any valid index for the layout. Some common use cases include limiting the fling distance, and rounding up/down to achieve snapping to groups of items.


fun flingBehavior(    state: PagerState,     decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),     snapAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec,     endContentPadding: Dp = 0.dp): FlingBehavior

Remember the default FlingBehavior that represents the scroll curve.

Please remember to provide the correct endContentPadding if supplying your own FlingBehavior to VerticalPager or HorizontalPager. See those functions for how they calculate the value.

Parameters

state

The PagerState to update.

decayAnimationSpec

The decay animation spec to use for decayed flings.

snapAnimationSpec

The animation spec to use when snapping.

endContentPadding

The amount of content padding on the end edge of the lazy list in pixels (end/bottom depending on the scrolling direction).