Closed jns-codeworks closed 4 days ago
Do you have a code snippit or project that reproduces the issue? You could also make changes to the sample:compose
app in this repo. It's not possible to debug the issue without a way to reproduce it.
It seems like LazyColumn
is causing the issue, when it is added to a Column
that contains an AsyncImage
.
Still this issue effects my device only.
Compose version: 1.7.0-beta02
@Composable
private fun CoilGifTest() {
val imageLoader = LocalContext.current.imageLoader
Surface {
Column {
AsyncImage(
model = "https://gf-mint-website.s3.amazonaws.com/STAGE2/images/5077.gif",
contentScale = ContentScale.Crop,
contentDescription = null,
imageLoader = imageLoader,
)
LazyColumn {
for (idx in 0..10) {
item {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier
.fillMaxWidth()
.height(80.dp)
) {
Text("$idx")
}
}
}
}
}
}
}
https://github.com/coil-kt/coil/assets/28293626/4c7e2d0c-f52a-4232-a0ed-696cf18b8f62
The same issue occurs when you add AsyncImage to a LazyColumn.
When I'm using GifDecoder instead of AnimatedImageDecoder everything works fine
Sorry I'm not able to reproduce this locally and can't debug without a way to reproduce this.
Gif playback is stopped as soon as the draw phase is finished and starts again when the composable is redrawn. I see this effect on coil 2.x and 3.x. on my device Xiaomi Redmi Note 11s Android 14. Android emulator with the same api level is not affected. Unfortunately I cannot reproduce when this effect occured for the first time, because gif playing used to work flawless. However, I have the impression it might be coming from a compose update.
https://github.com/coil-kt/coil/assets/28293626/23ff6cdf-4575-4697-ac0a-d68d0986a7c5