Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pager] Avoid Recomposing Page When the Page is invisible #1294

Closed
OXeu opened this issue Aug 14, 2022 · 3 comments
Closed

[Pager] Avoid Recomposing Page When the Page is invisible #1294

OXeu opened this issue Aug 14, 2022 · 3 comments
Assignees
Labels
stale Stale issues which are marked for closure

Comments

@OXeu
Copy link

OXeu commented Aug 14, 2022

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!

@dmitrytavpeko
Copy link
Contributor

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

@OXeu
Copy link
Author

OXeu commented Aug 14, 2022

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.

@github-actions
Copy link

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 github-actions bot added the stale Stale issues which are marked for closure label Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues which are marked for closure
Projects
None yet
Development

No branches or pull requests

3 participants