Skip to content

Is it possible to do crossfade between different quality versions of the same image on different urls? #1226

Discussion options

You must be logged in to vote

For anyone curious, I managed to get this behavior using two AsyncImages and image loading listeners:

var showLowRes = remember { true }
Box(modifier = Modifier
    .fillMaxSize()
    .background(MaterialTheme.colors.background)
) {
    if (showLowRes) {
        AsyncImage(
            modifier = Modifier
                .fillMaxWidth()
                .align(Alignment.Center),
            model = ImageRequest.Builder(LocalContext.current)
                .data(lowResUrl)
                .build(),
            contentScale = ContentScale.Fit,
            contentDescription = "",
        )
    }
    AsyncImage(
        modifier = Modifier
            .fillMaxWidth()
            .align(Align…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by savvasdalkitsis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant