I currently have the issue that I need to render html with images into TextViews.
This is possible with the Html.ImageGetter.
However when I load the html the images are not loaded yet, so I display a placeholder as image and want to load the images by triggering coil. I can do this by using a drawable that first displayes a placeholder and then render into that drawable later with the image loaded by coil.
What I've seen so far is that people created their own DrawablePlaceholder where an arbitrary image loading mechanism could render the image into:
https://gist.github.com/rajeefmk/beb1b79363c12041da7fd540bcf27765
However I wonder if Coil already has such a Drawable placeholder?
Or to make it more human understandibly: I want a way that Coil can render asynchronously into a drawable.
Ah just use Kotlin coroutines and Coil.get().
Uff I'm new to kotlin
You can implement a custom Target and set the placeholder for your request using LoadRequestBuilder.placeholder. The result should be pretty similar to the Picasso gist you linked.
BTW @theScrabi , big fan of your work on NewPipe 馃槃 Here is an implementation of an Html.Getter that I created and am using in a few projects:
:D thank you Same goes to you guys :)
Most helpful comment
:D thank you Same goes to you guys :)