What are people using for previewing async images?...
# compose-android
r
What are people using for previewing async images? Just wondering about a solution which is minimal and not too intrusive for production code. I was going to adjust the async image component to check
LocalInspectionMode.current
and render a local box with a placeholder, but not sure if there is a cleaner solution which doesn't involve the async image to actually fire the request.
s
thank you color 1
r
That works too, ty!
y
I think you can update the deprecated singleton image loader to avoid passing it as a param. And https://coil-kt.github.io/coil/testing/ which doesn't have any extra dependencies.
👍 1
s
The test artifact wouldn't really help in preview code though right? And the previews would still need to have some instance of the ImageLoader as a local, which all previews would still need to provide, is that correct or am I missing something in the new local? Passing it as a param was a deliberate decision for us actually so that we can do this much easier in our preview code.
s
Aha, this applies the composition local itself? How does this practically look like in your previews? I feel like I'm definitely missing something around how this is used