mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-10-04 19:53:28 +02:00
fix load image box size
This commit is contained in:
@@ -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? {
|
||||||
|
Reference in New Issue
Block a user