Currently all of the imperative APIs return a Drawable, which is great for drawing but it would be handy to know more information about the load itself. Things like: where did the image come from? (cache? network?)
I imagine something like the transition API:
enum class Source { DISK, MEMORY_CACHE, NETWORK }
sealed class LoadResult {
class Success(
val drawable: Drawable,
val source: Source
) : LoadResult()
class Error(
val drawable: Drawable?
) : LoadResult()
}
fun Coil.getResult(data: Any): LoadResult
This would be super useful for when Coil is being used in outside of View environments 🚀
WDYT?
Currently all of the imperative APIs return a
Drawable, which is great for drawing but it would be handy to know more information about the load itself. Things like: where did the image come from? (cache? network?)I imagine something like the transition API:
This would be super useful for when Coil is being used in outside of View environments 🚀
WDYT?