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