Hello!! Does the LazyRow has anything similar to r...
# compose
r
Hello!! Does the LazyRow has anything similar to recyclerview’s snaphelper?
n
n
I’d like to have just the snap behavior for the `LazyRow`…
🙌🏿 1
🙌 1
n
well if you find a way let me know 😄
😅 1
the solution is probably to code the behavior through the LazyListState, but as the snap would be a suspend method... I think the best would be to "recode" it
a
I experimented with this a while ago, feel free to try to tune for your needs: https://gist.github.com/andkulikov/c5cd7cd2b5b5bc2e74a9dc7255d2ebdf#file-2-snappinglazyrowdemo
r
@nitrog42 looks interesting! Thanks so much. I'm also experimenting with create my own Helper.
I also found this, maybe it is interesting for you guys
n
i would follow what @Andrey Kulikov linked as it's an official compose developer :D
👌🏿 1
and it's good because now I understand I misjudged what the flingbehavior do in a scrollable component
@Andrey Kulikov I think this gist should definitelly be linked in https://developer.android.com/jetpack/compose/lists in a Learn more category 😄
n
@Andrey Kulikov I tried this gist and the animation is very fast… doesn’t seems good 😕
n
try to tinker with
Animatable(scrollBy.toFloat()).animateTo(
but you will probably have to get your hands dirty to get the behavior as you want, if you want something that works out of the box, either the Accompanist Pager/compose-pager-snap-helper or wait for another lib