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

Shakil Karim

02/25/2021, 6:00 AM
Is there easy way to achieve snapping (paging) like behavior in LazyRow?
👀 1
2
a

Andrey Kulikov

02/25/2021, 12:45 PM
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

Vipulyaara

02/26/2021, 12:21 AM
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

Alexandre Elias [G]

02/26/2021, 2:32 AM
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

Vipulyaara

02/27/2021, 3:00 AM
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
14 Views