MonochromaticImageComplicationData.Builder


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

public final class MonochromaticImageComplicationData.Builder


Builder for MonochromaticImageComplicationData.

You must at a minimum set the monochromaticImage and contentDescription fields.

Summary

Public constructors

Builder(
    @NonNull MonochromaticImage monochromaticImage,
    @NonNull ComplicationText contentDescription
)

Public methods

@NonNull MonochromaticImageComplicationData

Builds the MonochromaticImageComplicationData.

final @NonNull MonochromaticImageComplicationData.Builder

Sets optional pending intent to be invoked when the complication is tapped.

final @NonNull MonochromaticImageComplicationData.Builder
setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.

Public constructors

Builder

Added in 1.0.0
public Builder(
    @NonNull MonochromaticImage monochromaticImage,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull MonochromaticImage monochromaticImage

The MonochromaticImage to be displayed

@NonNull ComplicationText contentDescription

The content description field for accessibility and is used to describe what data the icon represents. If the icon is purely stylistic, and does not convey any information to the user, then provide an empty content description. If no content description is provided, a generic content description will be used instead. Please do not include the word 'complication' in the description.

Public methods

setTapAction

Added in 1.0.0
public final @NonNull MonochromaticImageComplicationData.Builder setTapAction(PendingIntent tapAction)

Sets optional pending intent to be invoked when the complication is tapped.

setValidTimeRange

Added in 1.0.0
public final @NonNull MonochromaticImageComplicationData.Builder setValidTimeRange(TimeRange validTimeRange)

Sets optional time range during which the complication has to be shown.