You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
AsyncImagePainter's placeholder/fallback/error values are only updated when a state transition occurs. This is currently semi by design as those values are only used to overwrite the values provided by ImageRequest's placeholder/fallback/error, however in practice this can be unexpected. To figure out:
If we can update those values outside of state transitions caused by ImageLoader how does this affect onState and when it's called? Do we re-invoke the callback with Loading a second time if placeholder is updated?
To Reproduce
The following composable won't update to blue:
AsyncImage(
model =Unit, // Pass a value that errors immediately.
error = changingPainter(),
contentDescription =null,
)
@Composable
funchangingPainter(): Painter {
val painter by remember { mutableStateOf<Painter>(ColorPainter(Color.Red)) }
LaunchedEffect(Unit) {
delay(1_000)
painter =ColorPainter(Color.Blue)
}
return painter
}
Version
Reproduced on 2.4.0.
The text was updated successfully, but these errors were encountered:
Describe the bug
AsyncImagePainter's placeholder/fallback/error values are only updated when a state transition occurs. This is currently semi by design as those values are only used to overwrite the values provided by
ImageRequest
's placeholder/fallback/error, however in practice this can be unexpected. To figure out:ImageLoader
how does this affectonState
and when it's called? Do we re-invoke the callback withLoading
a second time ifplaceholder
is updated?To Reproduce
The following composable won't update to blue:
Version
Reproduced on
2.4.0
.The text was updated successfully, but these errors were encountered: