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

final @Nullable TimeUnit

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

Inherited methods

From class ComplicationText
@NonNull Instant

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

@NonNull CharSequence
getTextAt(@NonNull Resources resources, @NonNull Instant instant)

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

boolean
boolean
returnsSameText(
    @NonNull Instant firstInstant,
    @NonNull Instant secondInstant
)

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

Public methods

getMinimumTimeUnit

@Nullable
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.