Status.StopwatchPart

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

Object
   ↳ Status.Part
     ↳ Status.TimerOrStopwatchPart
       ↳ Status.StopwatchPart

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

Available since wear-ongoing:1.0.0

Summary

Public constructors

StopwatchPart(@NonNull long timeZeroMillis)

Create a Part representing a stopwatch.

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

Create a Part representing a stopwatch.

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

Create a Part representing a stopwatch.

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

StopwatchPart

public StopwatchPart(@NonNull long timeZeroMillis)

Create a Part representing a stopwatch.

Parameters
@NonNull long timeZeroMillis

timestamp of the time at which this stopwatch started running.

StopwatchPart

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

Create a Part representing a stopwatch.

Parameters
@NonNull long timeZeroMillis

timestamp of the time at which this stopwatch started running.

@NonNull long pausedAtMillis

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

StopwatchPart

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

Create a Part representing a stopwatch.

Parameters
@NonNull long timeZeroMillis

timestamp of the time at which this stopwatch started running.

@NonNull long pausedAtMillis

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

@NonNull long totalDurationMillis

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