MonochromaticImageComplicationData


public final class MonochromaticImageComplicationData extends ComplicationData


Type used for complications which consist only of a MonochromaticImage.

The image is expected to always be displayed.

A data source that wants to serve a MonochromaticImageComplicationData must include the following meta data in its manifest (NB the value is a comma separated list):

<meta-data android:name="android.support.wearable.complications.SUPPORTED_TYPES"
android:value="ICON"/>

Summary

Public fields

static final @NonNull ComplicationType

The ComplicationType corresponding to objects of this type.

Public methods

final ComplicationText

The content description field for accessibility.

final @NonNull MonochromaticImage

A simple MonochromaticImage image that can be tinted by the watch face (typically with SRC_IN).

boolean

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

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

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 methods

getContentDescription

Added in 1.0.0
public final ComplicationText getContentDescription()

The content description field for accessibility.

getMonochromaticImage

Added in 1.0.0
public final @NonNull MonochromaticImage getMonochromaticImage()

A simple MonochromaticImage image that can be tinted by the watch face (typically with SRC_IN). If the monochromaticImage is equal to MonochromaticImage.PLACEHOLDER the renderer must treat it as a placeholder rather than rendering normally, it's suggested it should be rendered as a light grey box.

hasPlaceholderFields

public boolean hasPlaceholderFields()

Returns true if any of the fields of this ComplicationData are placeholders. I.e. if any fields are equal to: ComplicationText.PLACEHOLDER, SmallImage.PLACEHOLDER, MonochromaticImage.PLACEHOLDER, PhotoImageComplicationData.PLACEHOLDER, or RangedValueComplicationData.PLACEHOLDER.

toString

public @NonNull String toString()