Package dev.chrisbanes.snapper

Types

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

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

Link copied to clipboard
object SnapOffsets

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

Link copied to clipboard
class SnapperFlingBehavior : FlingBehavior

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

Link copied to clipboard
object SnapperFlingBehaviorDefaults
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): 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,     decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay(),     springAnimationSpec: AnimationSpec<Float> = SnapperFlingBehaviorDefaults.SpringAnimationSpec,     snapIndex: (SnapperLayoutInfo, startIndex: Int, targetIndex: Int) -> Int = SnapperFlingBehaviorDefaults.SnapIndex): SnapperFlingBehavior

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