Android 12 Developer Preview is here! Try it out, and give us your feedback!

TimeReference

class TimeReference
kotlin.Any
   ↳ androidx.wear.complications.data.TimeReference

Expresses a reference point or range for a time difference.

It defines endDateTimeMillis and/or startDateTimeMillis to express the corresponding time differences relative to before, between or after the given point(s) in time.

Summary

Public methods
Boolean

Boolean

Companion functions
TimeReference
between(startDateTimeMillis: Long, endDateTimeMillis: Long)

Creates a TimeReference for the time difference between startDateTimeMillis and endDateTimeMillis.

TimeReference
ending(dateTimeMillis: Long)

Creates a TimeReference for the time difference ending at the given dateTimeMillis.

TimeReference
starting(dateTimeMillis: Long)

Creates a TimeReference for the time difference starting at the given dateTimeMillis.

Properties
Long

Long

Public methods

hasEndDateTimeMillis

fun hasEndDateTimeMillis(): Boolean

hasStartDateTimeMillis

fun hasStartDateTimeMillis(): Boolean

Properties

endDateTimeMillis

val endDateTimeMillis: Long

startDateTimeMillis

val startDateTimeMillis: Long

Companion functions

between

@JvmStatic fun between(
    startDateTimeMillis: Long,
    endDateTimeMillis: Long
): TimeReference

Creates a TimeReference for the time difference between startDateTimeMillis and endDateTimeMillis.

ending

@JvmStatic fun ending(dateTimeMillis: Long): TimeReference

Creates a TimeReference for the time difference ending at the given dateTimeMillis.

starting

@JvmStatic fun starting(dateTimeMillis: Long): TimeReference

Creates a TimeReference for the time difference starting at the given dateTimeMillis.