Google is committed to advancing racial equity for Black communities. See how.

TimeRange

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

A range of time, that may be unbounded on either side.

Summary

Public methods
operator Boolean
contains(dateTimeMillis: Long)

Returns whether the TimeRange contains a given point in time.

Companion functions
TimeRange
after(startDateTimeMillis: Long)

Constructs a time range after a given point in time.

TimeRange
before(endDateTimeMillis: Long)

Constructs a time range until a given point in time.

TimeRange
between(startDateTimeMillis: Long, endDateTimeMillis: Long)

Constructs a time range between two points in time, inclusive of the points themselves.

Properties
Long

Long

Companion properties
TimeRange

The TimeRange that includes every point in time.

Public methods

contains

operator fun contains(dateTimeMillis: Long): Boolean

Returns whether the TimeRange contains a given point in time.

Properties

endDateTimeMillis

val endDateTimeMillis: Long

startDateTimeMillis

val startDateTimeMillis: Long

Companion functions

after

@JvmStatic fun after(startDateTimeMillis: Long): TimeRange

Constructs a time range after a given point in time.

before

@JvmStatic fun before(endDateTimeMillis: Long): TimeRange

Constructs a time range until a given point in time.

between

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

Constructs a time range between two points in time, inclusive of the points themselves.

Companion properties

ALWAYS

val ALWAYS: TimeRange

The TimeRange that includes every point in time.