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

TimeDifferenceStyle

enum class TimeDifferenceStyle
kotlin.Any
   ↳ kotlin.Enum<androidx.wear.complications.data.TimeDifferenceStyle>
   ↳ androidx.wear.complications.data.TimeDifferenceStyle

The styling used for showing a time different by ComplicationText.timeDifferenceBuilder.

Summary

Enum values

Style for time differences shown in a short alpha-numeric style, with up to two significant units included.

Style for time differences shown in a short alpha-numeric style, with only the most significant unit included.

Style for time differences shown using (possibly abbreviated) words, with only the most significant unit included, that should fit within the character limit for a short text field.

Style for time differences shown in a numeric fashion like a timer.

Style for time differences shown using (possibly abbreviated) words, with only the most significant unit included.

Inherited extension functions
From androidx.core.util
infix Range<T>
T.rangeTo(that: T)

Creates a range from this Comparable value to that.

Enum values

SHORT_DUAL_UNIT

enum val SHORT_DUAL_UNIT : TimeDifferenceStyle

Style for time differences shown in a short alpha-numeric style, with up to two significant units included.

For time difference t:

If t < 1 hour, the value will be shown as a number of minutes, such as 2m for 2 minutes. Seconds are not displayed.

If 1 hour <= t < 1 day, the value will be shown as hours and minutes, such as 4h 2m for 4 hours and 2 minutes.

If 1 day <= t < 10 days, the value will be shown as days and hours, such as 3d 4h for 3 days 4 hours.

If 10 days <= t, the value will be shown as a number of days, such as 13d for 13 days.

The characters used will be localised to match the default locale. If the representation of the time difference with two units would be too long in the default locale, just a single unit may be shown instead.

SHORT_SINGLE_UNIT

enum val SHORT_SINGLE_UNIT : TimeDifferenceStyle

Style for time differences shown in a short alpha-numeric style, with only the most significant unit included.

For time difference t:

If t < 1 hour, the value will be shown as a number of minutes, such as 2m for 2 minutes . Seconds are not displayed.

If 1 hour <= t < 1 day, the value will be shown as a number of hours, such as 4h for 4 hours.

If 1 days <= t, the value will be shown as a number of days, such as 13d for 13 days.

The characters used will be localised to match the default locale.

SHORT_WORDS_SINGLE_UNIT

enum val SHORT_WORDS_SINGLE_UNIT : TimeDifferenceStyle

Style for time differences shown using (possibly abbreviated) words, with only the most significant unit included, that should fit within the character limit for a short text field.

The output will be the same as for WORDS_SINGLE_UNIT, except that if the text does not fit into the seven character limit then a shorter form will be used instead, e.g. 1356d instead of 1356 days.

STOPWATCH

enum val STOPWATCH : TimeDifferenceStyle

Style for time differences shown in a numeric fashion like a timer.

For time difference t:

If t < 1 hour, the value will be shown as minutes and seconds, such as 02:35 for 2 minutes and 35 seconds.

If 1 hour <= t < 1 day, the value will be shown as hours and minutes, such as 4:02 for 4 hours and 2 minutes, or as 12:02 for 12 hours and 2 minutes.

If 1 day <= t < 10 days, the value will be shown as days and hours, such as 3d 4h for 3 days 4 hours.

If 10 days <= t, the value will be shown as just days, such as 13d for 13 days.

The characters used will be localised to match the default locale.

WORDS_SINGLE_UNIT

enum val WORDS_SINGLE_UNIT : TimeDifferenceStyle

Style for time differences shown using (possibly abbreviated) words, with only the most significant unit included.

For time difference t:

If t < 1 hour, the value will be shown as a number of minutes, such as 1 min for 1 minute or 2 mins for 2 minutes. Seconds are not displayed.

If 1 hour <= t < 1 day, the value will be shown as a number of hours, such as 1 hour for 1 hour or 4 hours for 4 hours.

If 1 days <= t, the value will be shown as a number of days, such as 1 day for 1 day or 13 days for 13 days.

The words used will be localised to match the default locale.