myanmarking
04/18/2022, 10:32 AMLaunchedEffect(key1 = Unit) {
snapshotFlow { animationStage }
.filterNotNull()
.collectLatest { stage ->
when (stage) {
is stageA -> {
try {
while (isActive) {
animScale.animateTo(1.05f, tween(500))
animScale.animateTo(1f, tween(500))
}
} catch (e: Exception) {
if (e is CancellationException) {
launch {
withContext(NonCancellable) {
animScale.animateTo(1f, tween(500))
}
}
throw e
}
}
}
is stageB -> ...
is stageC -> ...
}
}
}
Chris Sinco [G]
04/18/2022, 5:33 PMmyanmarking
04/18/2022, 5:39 PMChris Sinco [G]
04/18/2022, 5:54 PMmyanmarking
04/18/2022, 6:00 PM