Closed wilinz closed 2 years ago
I'm facing the same issue with ExoPlayer. The video does not start preparing for display until it's on screen, which results in a delay before playing it and a performance impact.
I have the same issue with WebView. It keeps reloading every time I switch my tabs. Very annoying.
Starting with Version 0.19 there was a switch from the previous HorizontalPager to a LazyRow implementation. By definition a LazyRow only shows views inside the viewport thus the WebView keeps reloading every time.
both HorizontalPager and VerticalPager were re-written to be based on LazyRow and LazyColumn respectively https://google.github.io/accompanist/pager/#changes-in-v0190
This is also related to https://github.com/google/accompanist/issues/899 where the support for offscreenPageLimit
is discussed.
I noticed myself that in a setup with a Horizontal Pager with only 3 Tabs the tabs on the right hand side are kept and are recycled while tabs on the left are disposed immediately when they leave the viewport.
Seems like Pager don't save the state of the pages and recreate everything in the page when switching pages. Is there any solution for this?
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.
I think its rather obvious that there should be an option to keep the pages in memory. Why google keep making my life complicated? Do they like it?
Using foundation pager you can specify offscreen page limit. No need to vent here.
Jetpack Compose is a piece of shit 💩💩💩!!!
BIGGGGGGGGGG 💩💩💩 !!!
In my version, HorizontalPager has a parameter: beyondBoundsPageCount
, which can specify the number of pages you want to preload before or after the visible ones. When switching pages, the specified one will not reload, it keeps alive.
In my version, HorizontalPager has a parameter:
beyondBoundsPageCount
, which can specify the number of pages you want to preload before or after the visible ones. When switching pages, the specified one will not reload, it keeps alive.
This worked for me! Thanks
HorizontalPager cannot save the AndroidView state. When switching pages, the AndroidView factory will be triggered, resulting in view recreate. If WebView is used in HorizontalPager, the webpage will be reloaded when switching pages.