Status.TimerOrStopwatchPart

public abstract class Status.TimerOrStopwatchPart extends Status.Part

Known direct subclasses
Status.StopwatchPart

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

Status.TimerPart

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


Base class for TimerPart and StopwatchPart, defines the getters but can't be created directly, create one of those instead.

Summary

Public methods

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 methods

equals

public boolean equals(@Nullable Object obj)

getNextChangeTimeMillis

Added in 1.1.0-alpha01
public long getNextChangeTimeMillis(long fromTimeMillis)

See getNextChangeTimeMillis

getPausedAtMillis

Added in 1.0.0
public long getPausedAtMillis()
Returns
long

the timestamp of the time when this was paused. Use isPaused to determine if this is paused or not.

getText

Added in 1.1.0-alpha01
public @NonNull CharSequence getText(@NonNull Context context, long timeNowMillis)

See getText

getTimeZeroMillis

Added in 1.0.0
public long getTimeZeroMillis()
Returns
long

the time at which this Timer or Stopwatch will display 0, will usually be in the past for a stopwatch and in the future for timers.

getTotalDurationMillis

Added in 1.0.0
public long getTotalDurationMillis()
Returns
long

the total duration of this timer/stopwatch, if set. Use hasTotalDuration to determine if this has a duration set.

hasTotalDuration

Added in 1.0.0
public boolean hasTotalDuration()

Determines if this has a total duration set.

Returns
boolean

true if this the total duration was set, false if not.

hashCode

public int hashCode()

isCountDown

Added in 1.0.0
public boolean isCountDown()
Returns
boolean

false if this is a stopwatch or true if this is a timer.

isPaused

Added in 1.0.0
public boolean isPaused()

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

Returns
boolean

true if this is paused, false if it's running.