TimerSpan


@ExperimentalCarApi
@CarProtocol
class TimerSpan : CarSpan


A CarSpan that represents a timer.

This span can be used within text to display a live-updating timer. The timer will count up from the provided start time, which is based on the elapsed real time since device boot, as provided by SystemClock.elapsedRealtime().

For example, a TimerSpan can be used in a CarText to show how much time has passed since a certain event. The exact rendering of the timer is dependent on the car screen.

See also
CarSpan

Summary

Public functions

java-static TimerSpan
create(elapsedRealtimeMillis: Long)

Creates a TimerSpan from a start time in elapsed real time since device boot.

Boolean
equals(other: Any?)
Long

Returns the start time of the timer in milliseconds since device boot.

Int
String

Public functions

create

Added in 1.8.0-beta01
java-static fun create(elapsedRealtimeMillis: Long): TimerSpan

Creates a TimerSpan from a start time in elapsed real time since device boot.

The timer will count up if the provided elapsedRealtimeMillis is in the past relative to the current SystemClock.elapsedRealtime(), and will count down if it is in the future.

Parameters
elapsedRealtimeMillis: Long

the start time in milliseconds using SystemClock .elapsedRealtime().

equals

fun equals(other: Any?): Boolean

getElapsedRealtimeMillis

Added in 1.8.0-beta01
fun getElapsedRealtimeMillis(): Long

Returns the start time of the timer in milliseconds since device boot.

hashCode

fun hashCode(): Int

toString

fun toString(): String