Has anyone implemented image loading via remote co...
# compose
r
Has anyone implemented image loading via remote compose, using give AndroidBitmaploader impl, mine is getting error NetworkOnMainThreadException @Nicolas Roard @yschimke
b
Hey! That
NetworkOnMainThreadException
is basically Android telling you the image fetch is running on the main thread. You have to make the loader fully async.
☝️ 1
y
I ended up writing one that uses Coil. I check the cache and use that synchronously when present. Otherwise return an empty result, and start an Async load. I probably need to trigger an invalidation that I think I'm currently missing
r
Yeah, used that only for now, hoping it will be fixed in upcoming rc releases!
y
Please raise a bug, helps to have signal from someone using the library
👍 2
n
What you can also do is load the document in a separate thread, then once it's loaded pass it to the main thread (that's what we do in platform for the widgets)
r
Sounds promising, will try to implement it!