mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-09-27 21:16:23 +02:00
fix load image box size
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user