Remove crossfades and double composition on image success
This commit is contained in:
@@ -34,7 +34,6 @@ import androidx.security.crypto.EncryptedSharedPreferences
|
|||||||
import coil3.ImageLoader
|
import coil3.ImageLoader
|
||||||
import coil3.disk.DiskCache
|
import coil3.disk.DiskCache
|
||||||
import coil3.memory.MemoryCache
|
import coil3.memory.MemoryCache
|
||||||
import coil3.request.crossfade
|
|
||||||
import com.vitorpamplona.amethyst.service.LocationState
|
import com.vitorpamplona.amethyst.service.LocationState
|
||||||
import com.vitorpamplona.amethyst.service.notifications.PokeyReceiver
|
import com.vitorpamplona.amethyst.service.notifications.PokeyReceiver
|
||||||
import com.vitorpamplona.amethyst.service.okhttp.HttpClientManager
|
import com.vitorpamplona.amethyst.service.okhttp.HttpClientManager
|
||||||
@@ -155,7 +154,7 @@ class Amethyst : Application() {
|
|||||||
.Builder(this)
|
.Builder(this)
|
||||||
.diskCache { coilCache }
|
.diskCache { coilCache }
|
||||||
.memoryCache { memoryCache }
|
.memoryCache { memoryCache }
|
||||||
.crossfade(true)
|
// .crossfade(true)
|
||||||
|
|
||||||
fun encryptedStorage(npub: String? = null): EncryptedSharedPreferences = EncryptedStorage.preferences(instance, npub)
|
fun encryptedStorage(npub: String? = null): EncryptedSharedPreferences = EncryptedStorage.preferences(instance, npub)
|
||||||
|
|
||||||
|
|||||||
+19
-10
@@ -378,16 +378,7 @@ fun UrlImageView(
|
|||||||
is AsyncImagePainter.State.Success -> {
|
is AsyncImagePainter.State.Success -> {
|
||||||
SubcomposeAsyncImageContent(loadedImageModifier)
|
SubcomposeAsyncImageContent(loadedImageModifier)
|
||||||
|
|
||||||
AnimatedVisibility(
|
ShowHashAnimated(content, controllerVisible, Modifier.align(Alignment.TopEnd))
|
||||||
visible = controllerVisible.value,
|
|
||||||
modifier = Modifier.align(Alignment.TopEnd),
|
|
||||||
enter = remember { fadeIn() },
|
|
||||||
exit = remember { fadeOut() },
|
|
||||||
) {
|
|
||||||
Box(Modifier.align(Alignment.TopEnd), contentAlignment = Alignment.TopEnd) {
|
|
||||||
ShowHash(content)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else -> {}
|
else -> {}
|
||||||
}
|
}
|
||||||
@@ -485,6 +476,24 @@ private fun InlineDownloadIcon(showImage: MutableState<Boolean>) =
|
|||||||
DownloadForOfflineIcon(Size24dp)
|
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
|
@Composable
|
||||||
fun ShowHash(content: MediaUrlContent) {
|
fun ShowHash(content: MediaUrlContent) {
|
||||||
var verifiedHash by remember(content.url) { mutableStateOf<Boolean?>(null) }
|
var verifiedHash by remember(content.url) { mutableStateOf<Boolean?>(null) }
|
||||||
|
|||||||
Reference in New Issue
Block a user