This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CustomTimer(private val millisInFuture: Long, private val countDownInterval: Long) { | |
private var millisUntilFinished: Long = millisInFuture | |
private var timer = InternalTimer(this, millisInFuture, countDownInterval) | |
private var isRunning = false | |
var onTick: ((millisUntilFinished: Long) -> Unit)? = null | |
var onFinish: (() -> Unit)? = null | |
private class InternalTimer( |