Image flickers when url changes for rememberImagePainter
See original GitHub issueCurrently I’m using a library to reorder items in a LazyColumn. The library works and functions as expected. The issue I’m running into is that when an item is reordered in the list, it causes a recomposition because my state has changed since the position of the item has changed. This is fine, but when items in my list recompose, they might have different urls so it tries to load the new image for both items that had their positions change. This causes a flicker as it tries to load new images. I’ve tried to use caching to prevent rememberImagePainter
from having to go fetch the image again but I don’t think that’s how that works. I’ve tried to prevent the request from going through by providing an ExecuteCallback that returned false if the state wasn’t empty and that didn’t work either.
I would expect to be able to configure coil to not re-load an image when a url changes but instead use a cached version if it exists.
I’m using version 1.3.2 and it’s not device specific.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Facing the same issue as mentioned by @Swirastlynn with
2.1.0
even when disk and memory caching is applied. I happen to be using Coil in LazyRow.I can still observe flickering on
2.1.0
. It doesn’t always happen, but quite often. I haven’t set any caching, all setup is default.Code: