-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Reload contents when activity start #97
base: master
Are you sure you want to change the base?
Conversation
I've tested this PR. There is a severe issue. As the data reloads after |
Hum, that's really a bad bug, I'll fix it soon. |
@gejiaheng |
62f74bf
to
fe2db37
Compare
iterator.remove(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what conditions would the path be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When users restarted the picker activity, we will reload the album list first, and then check out whether the previously selected items still exist, if users deleted the image, PathUtils
will resolve nothing, that means we should move it out of selections.
I tested this PR again and got a little confused. When user goes to preview page or home to launcher, then comes back, Matisse restarts the loader and the |
|
Yeah, I understand most of the work you do. Do we have to recreate the loader? What if we don't recreate but just reload the loader? I'm sorry I am like a little cautious about this PR, because Zhihu App is heavily dependent on this library. |
@gejiaheng |
I'll conduct some more tests. Thanks for your patience. |
This is a workaround for the enhancement I proposed in #85 .
It basically reloads anything when activity is started, and find out whether the selections are valid. If an album user previously selected is not existed after reloading, we will navigate to the initial album.
For now, I simply clear all selections when contents changed.