TimeDifferenceComplicationText

public final class TimeDifferenceComplicationText implements ComplicationText


A ComplicationText that represents a time difference.

Summary

Nested types

TimeDifferenceComplicationText.Builder

Builder for ComplicationText representing a time difference.

Public methods

boolean
equals(Object other)
final TimeUnit

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

@NonNull Instant
getNextChangeTime(Instant afterInstant)

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

@NonNull CharSequence
getTextAt(Resources resources, Instant instant)

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

int
boolean
boolean
returnsSameText(Instant firstInstant, Instant secondInstant)

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

@NonNull String

Public methods

equals

public boolean equals(Object other)

getMinimumTimeUnit

public final TimeUnit getMinimumTimeUnit()

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

public @NonNull Instant getNextChangeTime(Instant afterInstant)

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

getTextAt

public @NonNull CharSequence