Status.TimerOrStopwatchPart

public abstract class Status.TimerOrStopwatchPart extends Status.Part implements TimeDependentText

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 constructors

Public methods

@Override boolean
@Override long
getNextChangeTimeMillis(long fromTimeMillis)

See getNextChangeTimeMillis

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

See getText

long
long
boolean

Determines if this has a total duration set.

@Override int
boolean
boolean

Determines if this Timer or Stopwatch is paused.

Public constructors

TimerOrStopwatchPart

public final TimerOrStopwatchPart()

Public methods

equals

@Override
public boolean equals(@Nullable Object obj)

getNextChangeTimeMillis

@Override
public long getNextChangeTimeMillis(long fromTimeMillis)

See getNextChangeTimeMillis

getPausedAtMillis

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

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

See getText

getTimeZeroMillis

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

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

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

@Override
public int hashCode()

isCountDown

public boolean isCountDown()
Returns
boolean

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

isPaused

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.