TimerOngoingActivityStatus
open class TimerOngoingActivityStatus : OngoingActivityStatus
OngoingActivityStatus
representing a timer or stopwatch.
Summary
Public constructors |
Create a Status representing a timer or stopwatch.
|
Create a Status representing a timer or stopwatch.
|
Create a Status representing a timer or stopwatch.
|
Create a Status representing stopwatch.
|
Public constructors
<init>
TimerOngoingActivityStatus(
timeZeroMillis: Long,
countDown: Boolean,
pausedAtMillis: Long,
totalDurationMillis: Long)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
Long: timestamp of the time at which this Timer should display 0, will be in the past for a stopwatch and usually in the future for timers. |
countDown |
Boolean: indicates if this is a stopwatch (when false or timer (when true ). |
pausedAtMillis |
Long: timestamp of the time when this timer was paused. Or -1L if this timer is running. |
totalDurationMillis |
Long: total duration of this timer/stopwatch, useful to display as a progress bar or similar. |
<init>
TimerOngoingActivityStatus(
timeZeroMillis: Long,
countDown: Boolean,
pausedAtMillis: Long)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
Long: timestamp of the time at which this Timer should display 0, will be in the past for a stopwatch and usually in the future for timers. |
countDown |
Boolean: indicates if this is a stopwatch (when false ) or timer (when true ). |
pausedAtMillis |
Long: timestamp of the time when this timer was paused. Or -1L if this timer is running. |
<init>
TimerOngoingActivityStatus(
timeZeroMillis: Long,
countDown: Boolean)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
Long: timestamp of the time at which this Timer should display 0, will be in the past for a stopwatch and usually in the future for timers. |
countDown |
Boolean: indicates if this is a stopwatch (when false ) or timer (when true ). |
<init>
TimerOngoingActivityStatus(timeZeroMillis: Long)
Create a Status representing stopwatch.
Parameters |
timeZeroMillis |
Long: timestamp of the time at which this Stopwatch started. |
Public methods
getNextChangeTimeMillis
open fun getNextChangeTimeMillis(fromTimeMillis: Long): Long
See OngoingActivityStatus#getNextChangeTimeMillis(long)
Parameters |
fromTimeMillis |
Long: current time, usually now as returned by android.os.SystemClock#elapsedRealtime() . In most cases getText and getNextChangeTimeMillis should be called with the exact same timestamp, so changes are not missed. |
Return |
Long |
the first point in time after fromTimeMillis when the displayed value of this status will change. returns Long.MAX_VALUE if the display will never change. |
getPausedAtMillis
open fun getPausedAtMillis(): Long
getTimeZeroMillis
open fun getTimeZeroMillis(): Long
Return |
Long |
the time at which this Timer will display 0, will be in the past for a stopwatch and usually in the future for timers. |
getTotalDurationMillis
open fun getTotalDurationMillis(): Long
hasTotalDuration
open fun hasTotalDuration(): Boolean
Determines if this timer has a total duration set.
Return |
Boolean |
true if this the total duration was set, false if not. |
hashCode
open fun hashCode(): Int
isCountDown
open fun isCountDown(): Boolean
Return |
Boolean |
false if this is a stopwatch or true if this is a timer. |
isPaused
open fun isPaused(): Boolean
Determines if this timer is paused. i.e. the display representation will not change over time.
Return |
Boolean |
true if this timer is paused, false if it's running. |