Kwik Count Down Timer
fun KwikCountDownTimer(timeMillis: Long, onTimeUpdate: (String) -> Unit, onTimerFinished: () -> Unit)
A countdown timer that displays the time remaining in the format "mm:ss".
Parameters
time Millis
The total time in milliseconds to count down from.
on Time Update
The callback that will be called every second with the current time remaining.
on Timer Finished
The callback that will be called when the timer reaches 0.
You can use it to display a countdown timer in your Composable. For example, you can use it to display a countdown timer in a quiz app. Or to wait for an OTP to be sent before allowing the user to resend it.
Example usage:
KwikCountDownTimer(
timeMillis = 60000L,
onTimeUpdate = { time ->
Text(time)
},
onTimerFinished = {
Text("Timer finished")
}
)
Content copied to clipboard