[Pager] Avoid Recomposing Page When the Page is invisible
Description If there is 3 screens totally, when we scroll to the 3rd(index:2) page, the 1st(index:0) page will be destroyed ,and when we ready to scroll to the 2nd(index:1) page, the 1st page would recompose which makes the UI thread blocked a few frames, especially when the page is complex such as the page with a LazyColumn with much complex items. And I could not find any method to avoid the page that far away from the current page recomposing.
Expected behavior
Is there any posibility to cache all the pages instead of the behavior that recycling the item and recomposing the item as the LazyRow or LazyColumn. Recompose the page is expensive!
What you are observing is the intendent behaviour. Pager is built on top of the LazyRow/LazyColumn. LazyRow/LazyColumn do not support this feature yet. I think the offscreenPageLimit is what you are looking for, but unfortunately it's not ready so far. You can track the progress in this issue: https://github.com/google/accompanist/issues/899
What you are observing is the intendent behaviour. Pager is built on top of the LazyRow/LazyColumn. LazyRow/LazyColumn do not support this feature yet. I think the offscreenPageLimit is what you are looking for, but unfortunately it's not ready so far. You can track the progress in this issue: #899
That's what I'm expected. Is there possible to build the pager with Column/Row instead of LazyColumn/LazyRow? Because it seems that there isn't any progress about this feature in the Compose official issue tracker.
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.