Removing crossfades that might reduce the loading speed

This commit is contained in:
Vitor Pamplona
2023-05-06 20:59:09 -04:00
parent 25a34dd2e8
commit dc0fe75b3d
4 changed files with 15 additions and 14 deletions
@@ -59,7 +59,6 @@ object BlurHashRequester {
.Builder(context) .Builder(context)
.data("bluehash:$encodedMessage") .data("bluehash:$encodedMessage")
.fetcherFactory(BlurHashFetcher.Factory) .fetcherFactory(BlurHashFetcher.Factory)
.crossfade(100)
.build() .build()
} }
} }
@@ -92,7 +92,6 @@ object Robohash {
.data("robohash:$message") .data("robohash:$message")
.fetcherFactory(HashImageFetcher.Factory) .fetcherFactory(HashImageFetcher.Factory)
.size(robotSize) .size(robotSize)
.crossfade(100)
.build() .build()
} }
} }
@@ -337,9 +337,10 @@ private fun aspectRatio(dim: String?): Float? {
@Composable @Composable
private fun DisplayUrlWithLoadingSymbol(content: ZoomableContent) { private fun DisplayUrlWithLoadingSymbol(content: ZoomableContent) {
var cnt by remember { mutableStateOf<ZoomableContent?>(null) } var cnt by remember { mutableStateOf<ZoomableContent?>(null) }
val scope = rememberCoroutineScope()
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
withContext(Dispatchers.IO) { scope.launch(Dispatchers.IO) {
delay(200) delay(200)
cnt = content cnt = content
} }
@@ -92,6 +92,7 @@ private fun OptionNote(
var optionTally by remember { mutableStateOf(Pair(BigDecimal.ZERO, defaultColor)) } var optionTally by remember { mutableStateOf(Pair(BigDecimal.ZERO, defaultColor)) }
LaunchedEffect(key1 = optionNumber, key2 = pollViewModel) { LaunchedEffect(key1 = optionNumber, key2 = pollViewModel) {
withContext(Dispatchers.IO) {
val myTally = pollViewModel.optionVoteTally(optionNumber) val myTally = pollViewModel.optionVoteTally(optionNumber)
val color = if ( val color = if (
pollViewModel.consensusThreshold != null && pollViewModel.consensusThreshold != null &&
@@ -106,6 +107,7 @@ private fun OptionNote(
optionTally = Pair(myTally, color) optionTally = Pair(myTally, color)
} }
} }
}
ZapVote( ZapVote(
baseNote, baseNote,