Hi, did anyone worked on Paging 3, i want to know ...
# android
k
Hi, did anyone worked on Paging 3, i want to know how we can mutate one item from paged list https://stackoverflow.com/questions/63171749/how-can-we-mutate-items-loaded-using-paging-3-android
g
I suspect it still immutable, same as Paging 2
j
With paging 2 you have to invalidate the entire list
but what you can do is store the list locally, in the paged data source factory for example
• pagination data source loads list and keeps reference to all data (in my case the domain objects before mapping to ui friendly objects) • when you press like button, invalidate the old list • from the pagination factory, fetch the old data from the invalidated list • construct new list with passing the old data • instead of fetching the new data in the initial loading, simply use the old data, which should have the new like state included.
If you pass on the new list to the existing paged list adapter (with submitList) then the paged list adapter will use a list differ to update your list
so if Paging 3 does this the same as paging 2, then this would be a start 🙂
k
hmm Yeah, looks like i have to store locally
i will try this @Joost Klitsie
c
Hi @Kuldwinder Singh, Please check my message in the stack over flow https://stackoverflow.com/a/63187011/1407554