When I use Coil image to load multiple images, with Modifier.placeholder applied to display the loading status, some of them fail to complete the loading.
It is strange that I need so many circumstances to reproduce this: if I use any other view in the if (url == null) block, the error will not happen. A scrollable container and Modifier.alpha(0.9f) are also necessary.
In my example I use the same image, but the error persists when different urls are used.
I've debugged it and it looks like it happens because of this code block - since Coil can't start drawing until Painter.onDraw is called, which won't happen(or may not happen?) if you don't call drawContent. I tried changing condition contentAlpha in 0.01f..0.99f to contentAlpha < 0.99f, and it solves the problem.
I expect all three image views to be displayed when loading finishes. The bug also reproduces when app restarts and coil is loading from disk cache, so it's not network error.
Screenshots?
With my sample code first image is always in loading state:
Describe the bug
When I use Coil image to load multiple images, with
Modifier.placeholder
applied to display the loading status, some of them fail to complete the loading.It is strange that I need so many circumstances to reproduce this: if I use any other view in the
if (url == null)
block, the error will not happen. A scrollable container andModifier.alpha(0.9f)
are also necessary.In my example I use the same image, but the error persists when different urls are used.
I've debugged it and it looks like it happens because of this code block - since Coil can't start drawing until
Painter.onDraw
is called, which won't happen(or may not happen?) if you don't calldrawContent
. I tried changing conditioncontentAlpha in 0.01f..0.99f
tocontentAlpha < 0.99f
, and it solves the problem.To Reproduce
Expected behavior
I expect all three image views to be displayed when loading finishes. The bug also reproduces when app restarts and coil is loading from disk cache, so it's not network error.
Screenshots?
With my sample code first image is always in loading state:
Environment: