Images not recomposing after changing the list of a LazyList
See original GitHub issuePlease complete the following information:
- Glide and Fresco v1.2.4
Describe the Bug:
I’m observing a Live Data List using observeAsState(). When I trigger a new event using value/postDelayed, the LazyList (LazyRow/LazyColumn) item recomposes everything (text, icons, colors) except the Glide/Fresco image, making the item keep the old image URL. I’m attaching a small video, you can see that when I remove an item for the list, the title and rating updates, but the image doesn’t. This doesn’t happen if I use the classic Accompanist Glide library. WhatsApp Video 2021-06-21 at 22.41.zip
Expected Behavior:
Whenever the list state changes, the image should recompose too.
Current Glide Code:
>@Composable
> fun PosterImage(posterURL:String){
> GlideImage(
> imageModel = posterURL,
> contentScale = ContentScale.FillWidth,
> circularRevealedEnabled = true,
> placeHolder = ImageBitmap.imageResource(R.drawable.entry_placeholder),
> alignment = Alignment.Center,
> modifier = Modifier
> .fillMaxWidth()
> .height(170.dp),
> requestOptions = RequestOptions().diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
> )
> }
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Jetpack Compose – LazyColumn not recomposing
I believe that Compose sees that the List is the same List object as before and assumes that there are no changes. My...
Read more >Lists and grids | Jetpack Compose - Android Developers
By default, each item's state is keyed against the position of the item in the list or grid. However, this can cause issues...
Read more >Gotchas in Jetpack Compose Recomposition - Stitch Fix
Only the new names in the list are triggering a log message. While this solution works, marking every ViewModel as @Stable is not...
Read more >Building Scrollable and Lazy Components in Jetpack Compose
In this tutorial, we'll be focusing on LazyColumn and LazyRow as they are more advanced since they have a built-in scrolling behavior and ......
Read more >Smart Tool Factory (@tool_smart) / Twitter
In Jetpack Compose recomposing whole list when an item changes a state, i.e selected, if you are not using SnapshotStateList you might trigger...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@skydoves Thanks a lot, the issue is fixed for me 😃
@davidsal @madhurgupta10 Released a new stable
1.2.8
!