SnapperFlingBehavior

class SnapperFlingBehavior : FlingBehavior

A snapping FlingBehavior for LazyListState. Typically this would be created via rememberSnapperFlingBehavior.

Note: the default parameter value for decayAnimationSpec is different to the value used in rememberSnapperFlingBehavior, due to not being able to access composable functions.

Constructors

Link copied to clipboard
fun SnapperFlingBehavior(    layoutInfo: SnapperLayoutInfo,     decayAnimationSpec: DecayAnimationSpec<Float>,     springAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec,     snapIndex: (SnapperLayoutInfo, startIndex: Int, targetIndex: Int) -> Int = SnapperFlingBehaviorDefaults.SnapIndex)

Functions

Link copied to clipboard
open suspend override fun ScrollScope.performFling(initialVelocity: Float): Float

Properties

Link copied to clipboard
var animationTarget: Int?

The target item index for any on-going animations.

Sources

Link copied to clipboard