Status Update
Comments
cl...@google.com <cl...@google.com> #2
Hello, can you please attach a sample that reproduces your error?
to...@gmail.com <to...@gmail.com> #3
I’ve attached two screen recordings demonstrating the mediator's behavior during the first and second launches after installation. Additionally,
cl...@google.com <cl...@google.com> #4
Based on first_launch_after_installation.mp4
, your paging state is indeed showing null
for nextKey, so it makes sense that Paging concluded there are no more items to load.
So I think the question is why the PagingState
contains only an empty page and null
values. My guess is either
- RemoteMediator REFRESH actually returned empty data - what is the returned
allNewsItems
value on initial REFRESH? - RemoteMediator REFRESH successfully loaded data and inserted it into database, but Paging hasn't processed that yet by the time Append is triggered, so PagingState is empty.
The second case doesn't seem likely though.
If you attach an executable app, I can look into this further.
Otherwise, you may gain more insight through Paging logs with adb shell setprop log.tag.Paging VERBOSE
. You can also try implementing RemoteKeys
in this
to...@gmail.com <to...@gmail.com> #5
Hey! I ran into this same issue. It is in fact the second case you mentioned and is documented
I've published a repo
cl...@google.com <cl...@google.com> #6
Nope - flipping the PagingSource jumpSupported flag at that point would not make a difference.
to...@gmail.com <to...@gmail.com> #7
Ok thanks. If there's too much complains before it's added I'll go the duplicated data path then.
cl...@google.com <cl...@google.com>
to...@gmail.com <to...@gmail.com> #8
Any reason for the refusal or any workaround for the need?
Description
Version used: 3.2.1
Devices/Android versions reproduced on:
Using Paging 3.2.1 from Compose and everything works well with placeholders and paging and everything.
But I can't figure an efficient way to disable jumping after pager is created when in a specific case. (Multi select in the list in this case).
Once they started to select items, I'd like to disable jumping if possible to ensure that the pages already loaded are kept in memory.
This avoids duplicating the data in memory for the selections and only work with the ids for example, and vastly improve efficiency for 99% of the use cases.
I'd like to avoid duplication and memory issues to cover just 1% of the cases.
Is there any possible solution or future possible solution or should I end up duplicating the data in preventive since I can't predict if they will jump and unload the pages. (Or is there a way to have a callback when pages are about to get cleared so I switch to duplication at that time?)