NoDataComplicationData


class NoDataComplicationData : ComplicationData


Type that can be sent by any complication data source, regardless of the configured type, when the complication data source has no data to be displayed. If no placeholder is included then watch faces may choose whether to render this in some way or leave the slot empty.

If a placeholder is included than its expected that it will be rendered. Its suggested the watch face renders the placeholder elements (text, title, smallImage, etc...) using solid grey blocks. Any non-placeholder elements included in placeholder must be rendered normally.

Some watchfaces may not support placeholders and in that case the NoDataComplicationData will be treated as being empty.

Summary

Public companion properties

ComplicationType

The ComplicationType corresponding to objects of this type.

Public constructors

Constructs a NoDataComplicationData without a placeholder.

Constructs a NoDataComplicationData with a placeholder which is allowed to contain placeholder fields (see hasPlaceholderFields) which must be drawn to look like placeholders.

Public functions

open String

Public properties

ComplicationText?

The content description field for accessibility.

ComplicationData?

An optional value that describes the original ComplicationData that was provided by the data source, following invalidation (see evaluation description in ComplicationData).

ComplicationData?

An optional ComplicationData which may contain placeholder fields (see hasPlaceholderFields).

Inherited functions

From androidx.wear.watchface.complications.data.ComplicationData
open operator Boolean
equals(other: Any?)
open Instant

Returns the next Instant after afterInstant at which any field of the complication may change.

open Boolean

Returns true if any of the fields of this ComplicationData are placeholders.

open Int

Inherited properties

From androidx.wear.watchface.complications.data.ComplicationData
ComponentName?

The ComponentName of the androidx.wear.watchface.complications.datasource.ComplicationDataSourceService that provided the ComplicationData.

Int

The display policy for this complication.

ComplicationData?

Used in case any dynamic value has been invalidated.

Int

The persistence policy for this complication.

PendingIntent?

The PendingIntent to send when the complication is tapped on.

Boolean

tapAction which is a PendingIntent unfortunately can't be serialized.

ComplicationType

The ComplicationType of this complication data.

TimeRange

The TimeRange within which the complication should be displayed.

Public companion properties

TYPE

val TYPEComplicationType

The ComplicationType corresponding to objects of this type.

Public constructors

NoDataComplicationData

Added in 1.0.0
NoDataComplicationData()

Constructs a NoDataComplicationData without a placeholder.

NoDataComplicationData

Added in 1.1.0
NoDataComplicationData(placeholder: ComplicationData)

Constructs a NoDataComplicationData with a placeholder which is allowed to contain placeholder fields (see hasPlaceholderFields) which must be drawn to look like placeholders. E.g. with grey boxes / arcs.

Public functions

toString

open fun toString(): String

Public properties

contentDescription

Added in 1.1.0
val contentDescriptionComplicationText?

The content description field for accessibility.

invalidatedData

Added in 1.3.0-alpha04
val invalidatedDataComplicationData?

An optional value that describes the original ComplicationData that was provided by the data source, following invalidation (see evaluation description in ComplicationData). This is set by the system for privileged watch faces with the com.google.wear.permission.GET_COMPLICATION_DYNAMIC_VALUE permission.

placeholder

Added in 1.1.0
val placeholderComplicationData?

An optional ComplicationData which may contain placeholder fields (see hasPlaceholderFields). The type of the placeholder must match the type of the ComplicationData that would have otherwise been sent. The placeholder is expected to be rendered if the watch face has been built with a compatible library, older libraries which don't support placeholders will ignore this field.