rememberSnapperFlingBehavior
Create and remember a snapping FlingBehavior to be used with LazyListState.
This is a convenience function for using rememberLazyListSnapperLayoutInfo and rememberSnapperFlingBehavior. If you require access to the layout info, you can safely use those APIs directly.
Parameters
The LazyListState to update.
Block which returns which offset the given item should 'snap' to. See SnapOffsets for provided values.
The decay animation spec to use for decayed flings.
The animation spec to use when snapping.
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.
Create and remember a snapping FlingBehavior to be used with the given layoutInfo.
Parameters
The SnapperLayoutInfo to use. For lazy layouts, you can use rememberLazyListSnapperLayoutInfo.
The decay animation spec to use for decayed flings.
The animation spec to use when snapping.
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.
Create and remember a snapping FlingBehavior to be used with the given layoutInfo.
Parameters
The SnapperLayoutInfo to use. For lazy layouts, you can use rememberLazyListSnapperLayoutInfo.
The decay animation spec to use for decayed flings.
The animation spec to use when snapping.