can anyone please let me know how can improve my G...
# compose
a
can anyone please let me know how can improve my GlildeImage in sense of recomposition :
Copy code
GlideImage(
    imageModel = { media.mediaPath },
    modifier = Modifier
        .fillMaxWidth()
        .aspectRatio(1f),
    requestOptions = {
        RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE)
    },
    imageOptions = ImageOptions(
        contentScale = ContentScale.Crop,
        contentDescription = stringResource(id = R.string.thumbnail)
    ),
    loading = {
        Image(
            modifier = Modifier
                .fillMaxWidth()
                .aspectRatio(1f),
            painter = painterResource(id = R.drawable.ic_default_thumbnail),
            contentDescription = stringResource(
                id = R.string.thumbnail
            ),
            contentScale = ContentScale.Crop
        )
    },
    failure = {
        Image(
            modifier = Modifier
                .fillMaxWidth()
                .aspectRatio(1f),
            painter = painterResource(id = R.drawable.ic_default_thumbnail),
            contentDescription = stringResource(
                id = R.string.thumbnail
            ),
            contentScale = ContentScale.Crop
        )
    },
)
­čžÁ 3
z
Please keep long code snippets to threads to help keep the main thread readable.