Status.TimerPart

public final class Status.TimerPart extends Status.Part, Status.TimerOrStopwatchPart implements TimeDependentText

Object
   ↳ Status.Part
     ↳ Status.TimerOrStopwatchPart
       ↳ Status.TimerPart

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

Available since wear-ongoing:1.0.0

Summary

Public constructors

TimerPart(@NonNull long timeZeroMillis)

Create a Part representing a timer.

TimerPart(@NonNull long timeZeroMillis, @NonNull long pausedAtMillis)

Create a Part representing a timer.

TimerPart(
    @NonNull long timeZeroMillis,
    @NonNull long pausedAtMillis,
    @NonNull long totalDurationMillis
)

Create a Part representing a timer.

Inherited methods

From class Status.TimerOrStopwatchPart
@Override @NonNull boolean
@Override @NonNull long
getNextChangeTimeMillis(@NonNull long fromTimeMillis)

See getNextChangeTimeMillis

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

See getText

@NonNull long
@NonNull long
@NonNull boolean

Determines if this has a total duration set.

@Override @NonNull int
@NonNull boolean
@NonNull boolean

Determines if this Timer or Stopwatch is paused.

Public constructors

TimerPart

public TimerPart(@NonNull long timeZeroMillis)

Create a Part representing a timer.

Parameters
@NonNull long timeZeroMillis

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

TimerPart

public TimerPart(@NonNull long timeZeroMillis, @NonNull long pausedAtMillis)

Create a Part representing a timer.

Parameters
@NonNull long timeZeroMillis

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

@NonNull long pausedAtMillis

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

TimerPart

public TimerPart(
    @NonNull long timeZeroMillis,
    @NonNull long pausedAtMillis,
    @NonNull long totalDurationMillis
)

Create a Part representing a timer.

Parameters
@NonNull long timeZeroMillis

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

@NonNull long pausedAtMillis

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

@NonNull long totalDurationMillis

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