How to make HorizontalPager loop back to the start...
# compose
m
How to make HorizontalPager loop back to the starting page from the last page?
v
I don't know. But that behaviour commonly called Carousel, it might help with searching.
a
Perhaps you could react to
pagerState.canScrollForward
and toggle the
reverseLayout
parameter in HorizontalPager? Or, if pages can be changed only by buttons and not by the user (
userScrollEnabled = false
), you can just programmatically tell pagerState to do what you want.