NoDataComplicationData


public final class NoDataComplicationData extends 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 fields

static final @NonNull 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 methods

final ComplicationText

The content description field for accessibility.

final ComplicationData

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

final ComplicationData

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

@NonNull String

Inherited methods

From androidx.wear.watchface.complications.data.ComplicationData
boolean
equals(Object other)
final ComponentName

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

final int

The display policy for this complication.

final ComplicationData

Used in case any dynamic value has been invalidated.

@NonNull Instant

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

final int

The persistence policy for this complication.

final PendingIntent

The PendingIntent to send when the complication is tapped on.

final boolean

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

final @NonNull ComplicationType

The ComplicationType of this complication data.

final @NonNull TimeRange

The TimeRange within which the complication should be displayed.

boolean

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

int
final void
setTapActionLostDueToSerialization(
    boolean tapActionLostDueToSerialization
)

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

Public fields

TYPE

public static final @NonNull ComplicationType TYPE

The ComplicationType corresponding to objects of this type.

Public constructors

NoDataComplicationData

Added in 1.0.0
public NoDataComplicationData()

Constructs a NoDataComplicationData without a placeholder.

NoDataComplicationData

Added in 1.1.0
public NoDataComplicationData(@NonNull ComplicationData placeholder)

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 methods

getContentDescription

Added in 1.1.0
public final ComplicationText getContentDescription()

The content description field for accessibility.

getInvalidatedData

Added in 1.3.0-alpha04
public final ComplicationData getInvalidatedData()

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.

getPlaceholder

Added in 1.1.0
public final ComplicationData getPlaceholder()

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.

toString

public @NonNull String toString()