TimeDifferenceComplicationText


class TimeDifferenceComplicationText : ComplicationText


A ComplicationText that represents a time difference.

Summary

Nested types

Builder for ComplicationText representing a time difference.

Public functions

open operator Boolean
equals(other: Any?)
TimeUnit?

Gets the smallest unit that may be shown in the time difference text.

open Instant
getNextChangeTime(afterInstant: Instant)

Returns the next time after afterInstant at which the text may change.

open CharSequence
getTextAt(resources: Resources, instant: Instant)

Returns the text that should be displayed for the given timestamp.

open Int
open Boolean
open Boolean
returnsSameText(firstInstant: Instant, secondInstant: Instant)

Returns true if the result of getTextAt will be the same for both firstInstant and secondInstant.

open String

Public functions

equals

open operator fun equals(other: Any?): Boolean

getMinimumTimeUnit

Added in 1.0.0
fun getMinimumTimeUnit(): TimeUnit?

Gets the smallest unit that may be shown in the time difference text. If specified, units smaller than this minimum will not be included.

getNextChangeTime

Added in 1.3.0-alpha04
open fun getNextChangeTime(afterInstant: Instant): Instant

Returns the next time after afterInstant at which the text may change.

getTextAt

Added in 1.3.0-alpha04
open fun getTextAt(resources: Resources, instant: Instant): CharSequence

Returns the text that should be displayed for the given timestamp.

Parameters
resources: Resources

Resources from the current context

instant: Instant

The Instant at which to sample the text

hashCode

open fun hashCode(): Int

isAlwaysEmpty

Added in 1.3.0-alpha04
open fun isAlwaysEmpty(): Boolean

returnsSameText

Added in 1.3.0-alpha04
open fun returnsSameText(firstInstant: Instant, secondInstant: Instant): Boolean

Returns true if the result of getTextAt will be the same for both firstInstant and secondInstant.

toString

open fun toString(): String