diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt index 57aa22156..7a19bb6c6 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/Amethyst.kt @@ -34,7 +34,6 @@ import androidx.security.crypto.EncryptedSharedPreferences import coil3.ImageLoader import coil3.disk.DiskCache import coil3.memory.MemoryCache -import coil3.request.crossfade import com.vitorpamplona.amethyst.service.LocationState import com.vitorpamplona.amethyst.service.notifications.PokeyReceiver import com.vitorpamplona.amethyst.service.okhttp.HttpClientManager @@ -155,7 +154,7 @@ class Amethyst : Application() { .Builder(this) .diskCache { coilCache } .memoryCache { memoryCache } - .crossfade(true) + // .crossfade(true) fun encryptedStorage(npub: String? = null): EncryptedSharedPreferences = EncryptedStorage.preferences(instance, npub) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt index bbdc0c696..4383e9b60 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/components/ZoomableContentView.kt @@ -378,16 +378,7 @@ fun UrlImageView( is AsyncImagePainter.State.Success -> { SubcomposeAsyncImageContent(loadedImageModifier) - AnimatedVisibility( - visible = controllerVisible.value, - modifier = Modifier.align(Alignment.TopEnd), - enter = remember { fadeIn() }, - exit = remember { fadeOut() }, - ) { - Box(Modifier.align(Alignment.TopEnd), contentAlignment = Alignment.TopEnd) { - ShowHash(content) - } - } + ShowHashAnimated(content, controllerVisible, Modifier.align(Alignment.TopEnd)) } else -> {} } @@ -485,6 +476,24 @@ private fun InlineDownloadIcon(showImage: MutableState) = DownloadForOfflineIcon(Size24dp) } +@Composable +fun ShowHashAnimated( + content: MediaUrlImage, + controllerVisible: MutableState, + modifier: Modifier, +) { + AnimatedVisibility( + visible = controllerVisible.value, + modifier = modifier, + enter = remember { fadeIn() }, + exit = remember { fadeOut() }, + ) { + Box(modifier, contentAlignment = Alignment.TopEnd) { + ShowHash(content) + } + } +} + @Composable fun ShowHash(content: MediaUrlContent) { var verifiedHash by remember(content.url) { mutableStateOf(null) }