I am trying to write an extension for integrating ...
# android
t
I am trying to write an extension for integrating
Glide
with coroutines :
Copy code
suspend fun RequestBuilder<Bitmap>.intoBitmap(width: Int, height: Int): Bitmap?
I expect that function to : 1. load a
Bitmap
(or
Drawable
) with the specified dimensions, 2. suspend until loaded (be it successful or failed), 3. gracefully handle cancellation. Do you have any guidance, or maybe a library that already does that ?
g
Check coroutine docs about writing coroutine adapters for asyncronous API
or some existing adapter from kotlinx.corotuines for example