Android 12 Developer Preview is here! Try it out, and give us your feedback!

ShortTextComplicationData

class ShortTextComplicationData : ComplicationData
kotlin.Any
   ↳ androidx.wear.complications.data.ComplicationData
   ↳ androidx.wear.complications.data.ShortTextComplicationData

Type used for complications where the primary piece of data is a short piece of text (expected to be no more than seven characters in length). The text may be accompanied by an icon or a title or both.

If only one of icon and title is provided, it is expected that it will be displayed. If both are provided, it is expected that at least one of these will be displayed.

Summary

Nested classes

Builder for ShortTextComplicationData.

Public methods
WireComplicationData

Boolean
isActiveAt(dateTimeMillis: Long)

Returns true if the complication is active and should be displayed at the given time.

Properties
ComplicationText?

MonochromaticImage?

ComplicationText

ComplicationText?

TimeRange?

Companion properties
ComplicationType

The ComplicationType corresponding to objects of this type.

Inherited properties

Public methods

asWireComplicationData

fun asWireComplicationData(): WireComplicationData

isActiveAt

fun isActiveAt(dateTimeMillis: Long): Boolean

Returns true if the complication is active and should be displayed at the given time. If this returns false, the complication should not be displayed.

This must be checked for any time for which the complication will be displayed.

Properties

contentDescription

val contentDescription: ComplicationText?

monochromaticImage

val monochromaticImage: MonochromaticImage?

text

val text: ComplicationText

title

val title: ComplicationText?

validTimeRange

val validTimeRange: TimeRange?

Companion properties

TYPE

val TYPE: ComplicationType

The ComplicationType corresponding to objects of this type.