Hi, i am looking for the way to perform a (maybe a static?) call with Coil in order to get the response to load into a Bitmap, is it possible? I mean, i do not want to have a (mandatory) loading into a ImageView or a Drawable.
Thanks.
You'll probably want to use a target. Something like:
val imageLoader = Coil.imageLoader(context) // or create your own instance
val request = LoadRequest.Builder(context)
.data("scheme://my/uri")
.target { drawable ->
val bitmap = (drawable as BitmapDrawable).bitmap
}
.build()
imageLoader.execute(request)
Hi, i'm tryng compile your code but:
Coil.imageLoader -> has private access
LoadRequest.Builder can not resolve Builder
Are you using the latest Coil version (0.10.1)?
You were right!! I was using older version, now it works like a charm!!
Many thanks!!
@colinrtwhite and I are happy to help!