Android 12 Developer Preview is here! Try it out, and give us your feedback!

TimerStatusPart

open class TimerStatusPart : StatusPart
kotlin.Any
   ↳ androidx.wear.ongoing.StatusPart
   ↳ androidx.wear.ongoing.TimerStatusPart

An Ongoing activity status (or part of it) representing a timer or stopwatch. Available since wear-ongoing:1.0.0

Summary

Public constructors
<init>(timeZeroMillis: Long, countDown: Boolean, pausedAtMillis: Long, totalDurationMillis: Long)

Create a Status representing a timer or stopwatch.

<init>(timeZeroMillis: Long, countDown: Boolean, pausedAtMillis: Long)

Create a Status representing a timer or stopwatch.

<init>(timeZeroMillis: Long, countDown: Boolean)

Create a Status representing a timer or stopwatch.

<init>(timeZeroMillis: Long)

Create a Status representing stopwatch.

Public methods
open Boolean
equals(other: Any?)

open Long
getNextChangeTimeMillis(fromTimeMillis: Long)

See TimeDependentText#getNextChangeTimeMillis(long)

open Long

open CharSequence
getText(@NonNull context: Context, timeNowMillis: Long)

See TimeDependentText#getText(Context, long)]

open Long

open Long

open Boolean

Determines if this timer has a total duration set.

open Int

open Boolean

open Boolean

Determines if this timer is paused.

Public constructors

<init>

TimerStatusPart(
    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>

TimerStatusPart(
    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>

TimerStatusPart(
    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>

TimerStatusPart(timeZeroMillis: Long)

Create a Status representing stopwatch.

Parameters
timeZeroMillis Long: timestamp of the time at which this Stopwatch started.

Public methods

equals

open fun equals(other: Any?): Boolean

getNextChangeTimeMillis

open fun getNextChangeTimeMillis(fromTimeMillis: Long): Long

See TimeDependentText#getNextChangeTimeMillis(long)

Parameters
fromTimeMillis Long: current time, usually now as returned by android.