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 methods

@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 methods

equals

@Override
@NonNull
public @Override boolean equals(@Nullable Object obj)

getNextChangeTimeMillis

@Override
@NonNull
public @Override long getNextChangeTimeMillis(@NonNull long fromTimeMillis)

See getNextChangeTimeMillis

getPausedAtMillis

@NonNull
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

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

See getText

getTimeZeroMillis

@NonNull
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

@NonNull
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

@NonNull
public boolean hasTotalDuration()

Determines if this has a total duration set.

Returns
boolean

{@code true} if this the total duration was set, {@code false} if not.

hashCode

@Override
@NonNull
public @Override int hashCode()

isCountDown

@NonNull
public boolean isCountDown()
Returns
boolean

{@code false} if this is a stopwatch or {@code true} if this is a timer.

isPaused

@NonNull
public boolean isPaused()

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

Returns
boolean

{@code true} if this is paused, {@code false} if it's running.