Is there easy way to achieve snapping (paging) li...
# compose
s
Is there easy way to achieve snapping (paging) like behavior in LazyRow?
👀 1
2
a
There is a FlingBehavior param on LazyRow which allows to build such behaviour, but if you are looking for ViewPager-like component please follow the upcoming implementation to be added in accompanist: https://github.com/chrisbanes/accompanist/pull/209
v
Is there a reason compose foundation or material doesn’t want to make a Pager component? It is already one of the most used and requested components as far as I know
a
We may someday add a pager to foundation/material. We have some concerns that if we add one in a rush, it may not make everyone happy because we've heard requests for many variations (for example with extra padding to snap to, ads in the middle with different behavior, etc).
💯 2
So we've focused so far on providing powerful low-level primitives like
FlingBehavior
that can allow building any of the possible variations on top of them. And enabling a multi-artifact style of development instead of a monolith so that it's elegant to use libraries like accompanist alongside compose.
👍 1
v
That’s good to know. I am sure we can build a much more powerful pager than the
ViewPager
given the flexibility compose brings with it. But I understand it takes time and will be a complex widget to make. Thanks for the update.
👍 1