PhotoImageComplicationData

public final class PhotoImageComplicationData extends ComplicationData


Type used for complications which consist only of an image that is expected to fill a large part of the watch face, large enough to be shown as either a background or as part of a high resolution complication.

The image is expected to always be displayed. The image may be shown as the background, any other part of the watch face or within a complication. The image is large enough to be cover the entire screen. The image may be cropped to fit the watch face or complication.

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

Summary

Nested types

Builder for PhotoImageComplicationData.

Public fields

static final @NonNull Icon

Used to signal the photo image should be rendered as a placeholder.

static final @NonNull ComplicationType

The ComplicationType corresponding to objects of this type.

Public methods

final ComplicationText

The content description field for accessibility.

final @NonNull Icon

The Icon that is expected to fill a large part of the watch face, large enough to be shown as either a background or as part of a high resolution 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

PLACEHOLDER

public static final @NonNull Icon PLACEHOLDER

Used to signal the photo image should be rendered as a placeholder. It's suggested that a placeholder ranged value be drawn as a grey arc with a percentage value selected by the renderer.

Note a placeholder may only be used in the context of NoDataComplicationData.placeholder.

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.

getPhotoImage

Added in 1.0.0
public final @NonNull Icon getPhotoImage()

The Icon that is expected to fill a large part of the watch face, large enough to be shown as either a background or as part of a high resolution complication. This must not be tinted. If the photoImage is equal to PhotoImageComplicationData.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()