https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

06/13/2022, 2:02 AM
Has anyone figured out how to have a
Row(Modifier.horizontalScroll())
but have the current item "snap" in place. I've looked at Chris Banes' snapper lib, but it only works with LazyRows. And HorizontalPager in accompanist is built on LazyRow so that's also a no-go. I need a non-lazy row/carousel impl with "snapping", but really can't find anything but I'm sort of finding it tough to believe no one has solved for this problem yet.
r

romainguy

06/13/2022, 2:05 AM
Why not use a lazy row?
Or port over accompanist's code to Row
f

Francesc

06/13/2022, 2:10 AM
I do snapping here, not exactly what you're after but maybe you can get some insights https://fvilarino.medium.com/recreating-google-podcasts-speed-selector-in-jetpack-compose-7623203a009d
❤️ 1
c

Colton Idle

06/13/2022, 2:45 PM
@ romainguy I can't use lazyrow because my designs require my items to all have the same height based on the tallest items height. Since my list only has 5 items max, to meet my designers request I have to use a nonLazy row.
2 Views