Feat: Trying to add a reload api for Coil #1946
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is trying to fix #884 #132
I use coil in my social apps, but in some cases, pictures may fail to load. I need to tell users and let them manually try to refresh or let coil reload pictures automatically. However, coil has not provided relevant api yet. After I checked # 884, I want to decide to try to submit a PR for coil to complete this function.
But the implementation is a bit rudimentary, and I'm trying to do it mainly with your public API idea under #884 comment
Now the general way to use it is like this:
if use
AsyncImage
and want to retry:demo.mp4
Although this does allow coil to reload images, the implementation is not very elegant
if use
AsyncImagePainter
:demo2.mp4
Since I'm not sure if AsyncImage has become stable, it's not clear if it's a good time to implement the reload api, but maybe we can discuss more specific api design & implementation here :)