TimerStatusPart
public
class
TimerStatusPart
extends StatusPart
An Ongoing activity status (or part of it) representing a timer or stopwatch.
Available since wear-ongoing:1.0.0
Summary
Public constructors |
TimerStatusPart(long timeZeroMillis, boolean countDown, long pausedAtMillis, long totalDurationMillis)
Create a Status representing a timer or stopwatch.
|
TimerStatusPart(long timeZeroMillis, boolean countDown, long pausedAtMillis)
Create a Status representing a timer or stopwatch.
|
TimerStatusPart(long timeZeroMillis, boolean countDown)
Create a Status representing a timer or stopwatch.
|
TimerStatusPart(long timeZeroMillis)
Create a Status representing stopwatch.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
androidx.wear.ongoing.TimeDependentText
abstract
long
|
getNextChangeTimeMillis(long fromTimeMillis)
Returns the timestamp of the next time when the display may be different from the one
at the specified time.
|
abstract
CharSequence
|
getText(Context context, long timeNowMillis)
Returns a textual representation of the ongoing activity status or a part of it
at the given time represented as milliseconds timestamp
For forward compatibility, the best way to display this is on a
TextView
|
|
Public constructors
TimerStatusPart
public TimerStatusPart (long timeZeroMillis,
boolean countDown,
long pausedAtMillis,
long totalDurationMillis)
Create a Status representing a timer or stopwatch.
| Parameters |
timeZeroMillis |
long: timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean: indicates if this is a stopwatch (when false or timer
(when true). |
pausedAtMillis |
long: timestamp of the time when this timer was paused. Or
-1L if this
timer is running. |
totalDurationMillis |
long: total duration of this timer/stopwatch, useful to display as a
progress bar or similar.
|
TimerStatusPart
public TimerStatusPart (long timeZeroMillis,
boolean countDown,
long pausedAtMillis)
Create a Status representing a timer or stopwatch.
| Parameters |
timeZeroMillis |
long: timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean: indicates if this is a stopwatch (when false) or timer
(when true). |
pausedAtMillis |
long: timestamp of the time when this timer was paused. Or
-1L if this timer is running.
|
TimerStatusPart
public TimerStatusPart (long timeZeroMillis,
boolean countDown)
Create a Status representing a timer or stopwatch.
| Parameters |
timeZeroMillis |
long: timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean: indicates if this is a stopwatch (when false) or timer
(when true).
|
TimerStatusPart
public TimerStatusPart (long timeZeroMillis)
Create a Status representing stopwatch.
| Parameters |
timeZeroMillis |
long: timestamp of the time at which this Stopwatch started.
|
Public methods
equals
public boolean equals (Object o)
getPausedAtMillis
public long getPausedAtMillis ()
| Returns |
long |
the timestamp of the time when this timer was paused. Use
isPaused() to determine if this timer is paused or not.
|
getTimeZeroMillis
public long getTimeZeroMillis ()
| Returns |
long |
the time at which this Timer will display 0, will be in the past for a stopwatch
and usually 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 timer has a
duration set.
|
hasTotalDuration
public boolean hasTotalDuration ()
Determines if this timer has a total duration set.
| Returns |
boolean |
true if this the total duration was set, false if not.
|
hashCode
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 is paused. i.e. the display representation will not change over
time.
| Returns |
boolean |
true if this timer is paused, false if it's running.
|