Package-level declarations

Types

Link copied to clipboard
annotation class ExperimentalSnapperApi
Link copied to clipboard
class LazyListSnapperLayoutInfo(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int, endContentPadding: Int = 0) : SnapperLayoutInfo

A SnapperLayoutInfo which works with LazyListState. Typically this would be remembered using rememberLazyListSnapperLayoutInfo.

Link copied to clipboard

Contains a number of values which can be used for the snapOffsetForItem parameter on rememberLazyListSnapperLayoutInfo and LazyListSnapperLayoutInfo.

Link copied to clipboard

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

Link copied to clipboard
abstract class SnapperLayoutInfo

Contains the necessary information about the scrolling layout for SnapperFlingBehavior to determine how to fling.

Link copied to clipboard
abstract class SnapperLayoutItemInfo

Contains information about a single item in a scrolling layout.

Functions

Link copied to clipboard
fun rememberLazyListSnapperLayoutInfo(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int = SnapOffsets.Center, endContentPadding: Dp = 0.dp): LazyListSnapperLayoutInfo

Create and remember a SnapperLayoutInfo which works with LazyListState.

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

Create and remember a snapping FlingBehavior to be used with the given layoutInfo.

fun rememberSnapperFlingBehavior(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int = SnapOffsets.Center, endContentPadding: Dp = 0.dp, decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(), springAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec): SnapperFlingBehavior
fun rememberSnapperFlingBehavior(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int = SnapOffsets.Center, endContentPadding: Dp = 0.dp, decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(), springAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec, snapIndex: (SnapperLayoutInfo, startIndex: Int, targetIndex: Int) -> Int): SnapperFlingBehavior

Create and remember a snapping FlingBehavior to be used with LazyListState.