ShortTextComplicationData.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 ShortTextComplicationData.Builder


Builder for ShortTextComplicationData.

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

Summary

Public constructors

Builder(
    @NonNull ComplicationText text,
    @NonNull ComplicationText contentDescription
)

Public methods

@NonNull ShortTextComplicationData

Builds the ShortTextComplicationData.

final @NonNull ShortTextComplicationData.Builder

Sets optional icon associated with the complication data.

final @NonNull ShortTextComplicationData.Builder

Sets optional image associated with the complication data.

final @NonNull ShortTextComplicationData.Builder

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

final @NonNull ShortTextComplicationData.Builder

Sets optional title associated with the complication data.

final @NonNull ShortTextComplicationData.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 ComplicationText text,
    @NonNull ComplicationText contentDescription
)
Parameters
@NonNull ComplicationText text

The main localized ComplicationText. This must be less than 7 characters long

@NonNull ComplicationText contentDescription

Defines localized text that briefly describes content of the complication. This property is used primarily for accessibility. Since some complications do not have textual representation this attribute can be used for providing such. Please do not include the word 'complication' in the description.

Public methods

build

Added in 1.0.0
public @NonNull ShortTextComplicationData build()

Builds the ShortTextComplicationData.

setMonochromaticImage

Added in 1.0.0
public final @NonNull ShortTextComplicationData.Builder setMonochromaticImage(MonochromaticImage monochromaticImage)

Sets optional icon associated with the complication data.

setSmallImage

Added in 1.2.0
public final @NonNull ShortTextComplicationData.Builder setSmallImage(SmallImage smallImage)

Sets optional image associated with the complication data.

setTapAction

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

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

setTitle

Added in 1.0.0
public final @NonNull ShortTextComplicationData.Builder setTitle(ComplicationText title)

Sets optional title associated with the complication data.

setValidTimeRange

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

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