-
Notifications
You must be signed in to change notification settings - Fork 259
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
List blinking when I restore state in fragment #167
Comments
It's also behave the save way as launchWhenCreated or launchWhenStarted if I use something like CoroutineScope(Dispatchers.IO).launch or any other dispatcher |
@artemkamko I believe you want to use the If you are still experiencing issues, please file a bug on the paging issue tracker, as github issues are specifically for the codelab. |
@tunjid Thanks for the answer. I did use cacheIn method in my viewModel where I store flow, but it's not help. |
@artemkamko hi again, I took another look and you're right. The issue seems to be because even through the remote mediator is not loading, it doesn't mean that the pager has fetched data from the db. So the list is made visible, the old list is shown, diff util calculates the change, removes the old items, then puts the new items in. I'll try experimenting with a debounce on the I reopened the issue as its very easy to repro with the codelab, so I'll keep updating you as I find out more details. |
@tunjid Ok, thanks |
@tunjid Hi, do you have any progress in this issue? |
Hi @tunjid and @artemkamko, any news about this? I am experiencing (maybe) the same issue. I have a bottom navigation view and two fragments in the navigation, both contain shared items so if, in the first fragment, I updated an item and then changed the fragment to the second one the list blinks. If I don't update the item the blink is not produced. Think that when the pagingSourceFactory invalidates is when the blink is produced. |
I have two fragments and bottom navigation. Every fragment contain list with paging. I use RemoteMediator to get data from api.
If I use launch in fragment then I always recreate list if I navigate between first and second fragment.
If I use launchWhenCreated or launchWhenStarted then list save it state, but when I navigate between first and second fragment it show blank list for maybe 1 second and it's create visual blinking.
How can I save paging 3 list state and show list immediately on fragment created?
The text was updated successfully, but these errors were encountered: