fix load image box size

This commit is contained in:
greenart7c3
2023-07-07 07:29:48 -03:00
parent 66952c9212
commit 0fead83279

View File

@@ -313,7 +313,8 @@ private fun UrlImageView(
fun LoadImageBox(showImage: MutableState<Boolean>) {
Box(
modifier = Modifier
.size(300.dp)
.height(300.dp)
.fillMaxWidth()
.clip(RoundedCornerShape(10.dp))
.background(Color.LightGray)
.clickable { showImage.value = true },
@@ -337,9 +338,8 @@ private fun AddedImageFeatures(
showImage: MutableState<Boolean>
) {
if (!showImage.value) {
return LoadImageBox(showImage)
}
LoadImageBox(showImage)
} else {
when (painter.value) {
null, is AsyncImagePainter.State.Loading -> {
if (content.blurhash != null) {
@@ -365,6 +365,7 @@ private fun AddedImageFeatures(
}
}
}
}
@Composable
@OptIn(ExperimentalLayoutApi::class)
@@ -377,9 +378,8 @@ private fun AddedImageFeatures(
showImage: MutableState<Boolean>
) {
if (!showImage.value) {
return LoadImageBox(showImage)
}
LoadImageBox(showImage)
} else {
var verifiedHash by remember {
mutableStateOf<Boolean?>(null)
}
@@ -421,6 +421,7 @@ private fun AddedImageFeatures(
}
}
}
}
private fun aspectRatio(dim: String?): Float? {
if (dim == null) return null