Is it possible to tell `SnapFlingBehavior` to snap...
# compose
k
Is it possible to tell
SnapFlingBehavior
to snap only to specific items (positions)? I want to snap only to
stickyHeaders
, not any item on the list.
d
the documentation of SnapFlingBehavior say
Copy code
// If you'd like to customize either the snap behavior or the layout provider
val snappingLayout = remember(state) { SnapLayoutInfoProvider(state) }
val flingBehavior = rememberSnapFlingBehavior(snappingLayout)
I believe you can implement a
SnapLayoutInfoProvider
that only provides snap points for the headers
k
Right, somehow, I missed that part. Thanks
d
I'd look at how the default SnapLayoutInfoProvider works and just modify it to do what it does on headers 😄
675 Views