question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Images not recomposing after changing the list of a LazyList

See original GitHub issue

Please 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
madhurgupta10commented, Jul 19, 2021

@skydoves Thanks a lot, the issue is fixed for me 😃

2reactions
skydovescommented, Jul 16, 2021

@davidsal @madhurgupta10 Released a new stable 1.2.8!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found