singleAdvanceFlingBehavior

@Composable
fun singleAdvanceFlingBehavior(state: CarouselState, snapAnimationSpec: AnimationSpec<Float> = spring(stiffness = Spring.StiffnessMediumLow)): TargetedFlingBehavior

A TargetedFlingBehavior that limits a fling to one item at a time. snapAnimationSpec can be used to control the snap animation.

Return

An instance of TargetedFlingBehavior that performs snapping to the next item. The animation will be governed by the post scroll velocity and the Carousel will use snapAnimationSpec to approach the snapped position

Parameters

state

The CarouselState that controls which Carousel this TargetedFlingBehavior will be applied to.

snapAnimationSpec

The animation spec used to finally snap to the position.