Add support for loading placeholder image from cache via URL
See original GitHub issueFirst up, congrats on shipping!
A feature request for consideration. Sometimes an app will show a list of small image thumbnails, which are clickable to open the image full screen. The thumbnails are physically small (in dimension and file size) so the list of thumbnails loads quickly. The full images (loaded from a different URL to the thumbnail) are much bigger, so might take a few seconds to load from the network.
Currently, Coil supports specifying a placeholder Drawable
using the placeholder
method. It would be good if that was extended to allow passing in the URL of the thumbnail, which presumably would still be in the memory cache because it was being displayed on the previous screen.
The desired effect would look like the image sampling mentioned on the docs website. So the low-res thumbnail would be shown until the full-res image has loaded. The API difference being the first low-res image has come from a different URL, rather than the same one.
I’ve used “URL” above to keep the wording simple, but I mean all the different “sources” in general that are parameters to the ImageLoader.load
methods (String
, Uri
, HttpUrl
, etc), or the loadAny
method that uses a Mapper.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:14 (2 by maintainers)
Top GitHub Comments
Probably the below code works better. Need to test:
Slight changes to kasem-sm’s reply: