zt
04/13/2023, 5:11 AMmgrazianodecastro
04/13/2023, 6:47 AMvar ticks by remember { mutableStateOf(0) }
LaunchedEffect(Unit) {
while(true) {
delay(1.seconds)
ticks++
}
}
you would derive a state from it, where when it reaches a value, the "goes away" is triggered.
And, to reset the counter, set some input gesture detector on the scope of the composableZach Klippenstein (he/him) [MOD]
04/13/2023, 6:11 PMclass ViewModel {
private val liveness = Channel<Unit>()
fun poke() {
liveness.trySend(Unit)
}
suspend fun run() {
liveness.receiveAsFlow()
.collectLatest {
delay(timeout)
hideStuff()
}
}
}
mgrazianodecastro
04/13/2023, 6:12 PM