Status.TimerPart

public final class Status.TimerPart extends Status.TimerOrStopwatchPart


An Ongoing activity status (or part of it) representing a timer.

Available since wear-ongoing:1.0.0

Summary

Public constructors

TimerPart(long timeZeroMillis)

Create a Part representing a timer.

TimerPart(long timeZeroMillis, long pausedAtMillis)

Create a Part representing a timer.

TimerPart(
    long timeZeroMillis,
    long pausedAtMillis,
    long totalDurationMillis
)

Create a Part representing a timer.

Inherited methods

From androidx.wear.ongoing.Status.TimerOrStopwatchPart
boolean
long
getNextChangeTimeMillis(long fromTimeMillis)

See getNextChangeTimeMillis

long
@NonNull CharSequence
getText(@NonNull Context context, long timeNowMillis)

See getText

long
long
boolean

Determines if this has a total duration set.

int
boolean
boolean

Determines if this Timer or Stopwatch is paused. i.e. the display representation will not change over time.

Public constructors

TimerPart

Added in 1.0.0
public TimerPart(long timeZeroMillis)

Create a Part representing a timer.

Parameters
long timeZeroMillis

timestamp of the time at the future in which this Timer should display 0.

TimerPart

Added in 1.0.0
public TimerPart(long timeZeroMillis, long pausedAtMillis)

Create a Part representing a timer.

Parameters
long timeZeroMillis

timestamp of the time at the future in which this Timer should display 0.

long pausedAtMillis

timestamp of the time when this timer was paused. Or -1L if this timer is running.

TimerPart

Added in 1.0.0
public TimerPart(
    long timeZeroMillis,
    long pausedAtMillis,
    long totalDurationMillis
)

Create a Part representing a timer.

Parameters
long timeZeroMillis

timestamp of the time at the future in which this Timer should display 0.

long pausedAtMillis

timestamp of the time when this timer was paused. Or -1L if this timer is running.

long totalDurationMillis

total duration of this timer, useful to display as a progress bar or similar.