accompanist
accompanist copied to clipboard
[Pager] Support offscreenPageLimit
Is your feature request related to a problem? Please describe.
Currently to achieve with HorizontalPager
displaying partially next/previous page we have to define contentPaddings
. However it is not always desirable. With ViewPager2
we can manipulate page in page transformer (e.g set transalationX) along with offscreenPageLimit = 1
Describe the solution you'd like
HorizontalPager
and VerticalPager
should support offscreenPageLimit
the same as ViewPager2
does
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
Is this closed just because of inactivity?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
On what exact dependency are we waiting for in this issue?
https://issuetracker.google.com/issues/172029355
Please use the bug above to track that. Once we have that in lazy lists we will add this functionality in the new Pager we are working on for Compose UI
@andkulikov The linked issue is fixed since October 17. By "new Pager for Compose UI", do you mean a different component than this library's pager? If yes, is there any information on a roadmap for this component? If no, is there any information when Accompanist's pager will take up the new LazyList offscreen capacity?
@mtotschnig hey, we are currently designing a new Pager component which will live right in compose.foundation and it will be a replacement for Accompanist's Pager. We are planning to provide an experimental version of this component in Compose 1.4. It will have an api for setting offscreenPageLimit
The referenced implementation is here:
https://github.com/androidx/androidx/blob/androidx-main/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/pager/Pager.kt