LazyListSnapperLayoutInfo
class LazyListSnapperLayoutInfo(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int) : SnapperLayoutInfo
Content copied to clipboard
A SnapperLayoutInfo which works with LazyListState. Typically this would be remembered using rememberLazyListSnapperLayoutInfo.
Parameters
lazyListState
The LazyListState to update.
snapOffsetForItem
Block which returns which offset the given item should 'snap' to. See SnapOffsets for provided values.
Constructors
Link copied to clipboard
fun LazyListSnapperLayoutInfo(lazyListState: LazyListState, snapOffsetForItem: (layoutInfo: SnapperLayoutInfo, item: SnapperLayoutItemInfo) -> Int)
Content copied to clipboard
Functions
Link copied to clipboard
Returns true if the layout has some scroll range remaining to scroll towards the end.
Link copied to clipboard
Returns true if the layout has some scroll range remaining to scroll towards the start.
Link copied to clipboard
open override fun determineTargetIndex( velocity: Float, decayAnimationSpec: DecayAnimationSpec<Float>, maximumFlingDistance: Float): Int
Content copied to clipboard
Calculate the desired target which should be scrolled to for the given velocity.
Link copied to clipboard
Calculate the distance in pixels needed to scroll to the given index. The value returned signifies which direction to scroll in: