Describe the bug
When I run my App on the Phone it has a different behavior when compared to the emulator.
Emulator:
You may find my code on this repository DC-Villains_Fix_Coil_Image_Loading
Phone:
Expected behavior
I want to have the same behavior across all devices in which:
I would open the app:
To Reproduce
Run the app on an emulator and wait for the images to load, rotate the device 2 or 3 times to see changes. Scroll a bit then rotate the phone again 2 or 3 times
Test the same on a physical device as well.
Logs/Screenshots



Version
minSdkVersion 19
targetSdkVersion 30
compileSdkVersion 30
coil version '0.11.0'
Thanks for the detailed report. It's possible for the Android Emulator to have different behaviour from the device due to how the system is emulated, however I'd expect the real device to be the one to work correctly. I'll take a look at this and see what I can find.
Not sure if this is relevant. I wanted to post because I observed different behaviors on Phone vs Emulator. But my experience was quite opposite. I spent 3 hours on emulator figuring out why image is not loaded. Then (luckily) I tried on real device and it was all good there.
@doilio The card background isn't being set because you're setting the background colour inside the Transformation. If the image is returned from the memory cache, Transformation.transform won't be run. When you rotate the phone twice, the list of images will likely still be cached in the memory cache.
Check out this recipe for safe ways to compute the palette that will work if the image is returned from the memory cache.
Most helpful comment
Not sure if this is relevant. I wanted to post because I observed different behaviors on Phone vs Emulator. But my experience was quite opposite. I spent 3 hours on emulator figuring out why image is not loaded. Then (luckily) I tried on real device and it was all good there.