accompanist icon indicating copy to clipboard operation
accompanist copied to clipboard

[Pager] Support offscreenPageLimit

Open lsuski opened this issue 3 years ago • 5 comments

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

lsuski avatar Dec 01 '21 12:12 lsuski

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.

github-actions[bot] avatar Jan 01 '22 03:01 github-actions[bot]

Is this closed just because of inactivity?

lsuski avatar Jan 06 '22 09:01 lsuski

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.

github-actions[bot] avatar Feb 10 '22 03:02 github-actions[bot]

On what exact dependency are we waiting for in this issue?

Nek-12 avatar Jul 13 '22 13:07 Nek-12

https://issuetracker.google.com/issues/172029355

andkulikov avatar Jul 20 '22 16:07 andkulikov

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 avatar Oct 05 '22 15:10 andkulikov

@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 avatar Nov 08 '22 16:11 mtotschnig

@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

andkulikov avatar Nov 08 '22 19:11 andkulikov

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

dazza5000 avatar Jan 31 '23 13:01 dazza5000