Assigned
Status Update
Comments
cl...@google.com <cl...@google.com> #2
Hello, can you please attach a sample that reproduces your error?
No update yet.
Hello, can you please attach a sample that reproduces your error?
Description
Component used: androidx.paging:paging-compose
Version used: 3.2.1
Devices/Android versions reproduced on: N/A
I have a screen which consumes 2 network responses, a primary and a paged secondary.
The secondary response is used to fill a horizontally scrolling row which pages more data from the network as needed.
When the primary response returns, it provides me the first page of the secondary response, so ideally I can seed this data into the secondary Pager so that I don't have to wait 1 recomposition cycle for the data to be available.
I was pointed to this line, which indicates some support exists internally, but this isn't exposed in any public API I could fine.
This would allow me to provide the first page without having to do
This misses rendering on the first frame, which means that other content shifts in order to animate the horizontal row in.
Maybe the API should be something like
Pager(initialPages: List<LoadResult.Page>)
, so you could provide multiple pages. I don't know if you'd also need associated keys. It would be nice such that if initial pages were provided, thePagingSource
would never callload
for those keys, so I can avoid adding the redirect mentioned above to point the first page to the main response instead of hitting the network. But that might not mesh with the refresh APIs, which expect fresh pages.