From 9c715dd381c1413f4f0b2b25a9035aab23b7dcc7 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Sat, 22 Apr 2023 15:02:33 -0400 Subject: [PATCH] Fixing the position of the image loading animation --- .../ui/components/ZoomableContentView.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt index 567730af9..496697e62 100644 --- a/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt +++ b/app/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt @@ -148,6 +148,14 @@ fun ZoomableContentView(content: ZoomableContent, images: List ) if (content is ZoomableImage) { + if (imageState !is AsyncImagePainter.State.Success) { + if (content.bluehash != null) { + DisplayBlueHash(content, mainImageModifier) + } else { + DisplayUrlWithLoadingSymbol(content) + } + } + Box() { AsyncImage( model = content.url, @@ -162,13 +170,7 @@ fun ZoomableContentView(content: ZoomableContent, images: List } ) - if (imageState !is AsyncImagePainter.State.Success) { - if (content.bluehash != null) { - DisplayBlueHash(content, mainImageModifier) - } else { - DisplayUrlWithLoadingSymbol(content) - } - } else { + if (imageState is AsyncImagePainter.State.Success) { HashVerificationSymbol(verifiedHash, Modifier.align(Alignment.TopEnd)) } } @@ -183,7 +185,7 @@ fun ZoomableContentView(content: ZoomableContent, images: List @Composable private fun DisplayUrlWithLoadingSymbol(content: ZoomableContent) { - ClickableUrl(urlText = "$content ", url = content.url) + ClickableUrl(urlText = "${content.url} ", url = content.url) val myId = "inlineContent" val emptytext = buildAnnotatedString {