mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-03-18 05:41:56 +01:00
Remove crossfades and double composition on image success
This commit is contained in:
parent
7fe02fcf2c
commit
1f3a818922
@ -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)
|
||||
|
||||
|
@ -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<Boolean>) =
|
||||
DownloadForOfflineIcon(Size24dp)
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun ShowHashAnimated(
|
||||
content: MediaUrlImage,
|
||||
controllerVisible: MutableState<Boolean>,
|
||||
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<Boolean?>(null) }
|
||||
|
Loading…
x
Reference in New Issue
Block a user