here is my code ```@Composable fun ImageItem(image...
# compose
l
here is my code
Copy code
@Composable
fun ImageItem(image: ImageModel, onClickImage: (ImageModel) -> Unit) {
    Surface(modifier = Modifier.clickable(onClick = { onClickImage(image) })) {
        Column {
            Box(
            ) {
                GlideImage(
                    imageModel = image.imagePath.toUri(),
                    requestOptions = RequestOptions()
                        .override(500, 500)
                        .diskCacheStrategy(DiskCacheStrategy.ALL)
                )
            }
            Text(text = image.name)
        }
    }
}
a
i think the issue here is that the image is loading asynchronous and for free frames your item has zero size. this confuses the scrolling and dynamic item creations. it would be nice if you can set some fixed size for the items
l
@Andrey Kulikov Each image has different width and width, so it cannot be arbitrarily specified. What should I do?
a
maybe you can at least provide some min height?
l
I can apply min, but the problem still occurs.
g
It doesn't look like a problem unique for compose, Recycler View would have the same problem for such case To mitigate it, GlideImage could cache bitmap to memory (or at least size of it) and set it immediately, if it available, instead of doing async request Also, I would check that memory cache is enabled and images have reasonable size