CountUpTimer

val countUpTimer = object : CountUpTimer(ALLOWED_MS_OF_INACTIVITY) { override fun onTimerTick(timeRemaining: Long) {

}

override fun onTimerFinish() {

} } countUpTimer.startTimer()

Constructors

Link copied to clipboard
constructor()
constructor(timeInMillis: Long)
constructor(timeInMillis: Long, intervalInMillis: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

To pause the timer from Main thread.

Link copied to clipboard

Convenience method to check whether the timer is running or not

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun onTimerFinish()

Method to be called by CountUpTimer when the thread is getting IsFinished

Link copied to clipboard
abstract fun onTimerTick(timeRemaining: Long)

Method to be called every second by the CountUpTimer

Link copied to clipboard

Convenience method to pause the timer.

Link copied to clipboard

Convenience method to resume the timer.

Link copied to clipboard
fun setInterval(intervalInMillis: Long)

Setter for interval.

Link copied to clipboard
fun setTime(timeInMillis: Long)

Setter for Time.

Link copied to clipboard

Method to start the timer.

Link copied to clipboard
fun stopTimer(shouldCallTimerFinish: Boolean = true)

Method to stop the timer.