SmallImageComplicationData

public final class SmallImageComplicationData extends ComplicationData


Type used for complications which consist only of a SmallImage.

The image is expected to always be displayed.

A data source that wants to serve a SmallImageComplicationData 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="SMALL_IMAGE"/>

Summary

Nested types

Builder for SmallImageComplicationData.

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 SmallImage

The SmallImage that is expected to cover a small fraction of a watch face occupied by a single complication.

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.

getSmallImage

Added in 1.0.0
public final @NonNull SmallImage getSmallImage()

The SmallImage that is expected to cover a small fraction of a watch face occupied by a single complication. If the smallImage is equal to SmallImage.PLACEHOLDER the renderer must treat it as a placeholder rather than rendering normally, its 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()