ContentDescriptionLabel


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 ContentDescriptionLabel


Describes regions of the watch face for use by a screen reader.

Summary

Public constructors

ContentDescriptionLabel(
    @NonNull ComplicationText text,
    @NonNull Rect bounds,
    PendingIntent tapAction
)

Public methods

boolean
equals(Object other)
final @NonNull Rect

Rect describing the area of the feature on screen.

final PendingIntent

PendingIntent to be used if the screen reader's user triggers a tap action.

final @NonNull ComplicationText

ComplicationText associated with the region, to be read by the screen reader.

final @NonNull CharSequence
getTextAt(@NonNull Resources resources, @NonNull Instant instant)

Returns the text that should be displayed for the given timestamp.

int

Public constructors

ContentDescriptionLabel

Added in 1.0.0
public ContentDescriptionLabel(
    @NonNull ComplicationText text,
    @NonNull Rect bounds,
    PendingIntent tapAction
)
Parameters
@NonNull ComplicationText text

ComplicationText associated with the region, to be read by the screen reader.

@NonNull Rect bounds

Rect describing the area of the feature on screen.

PendingIntent tapAction

PendingIntent to be used if the screen reader's user triggers a tap action.

Public methods

equals

public boolean equals(Object other)

getBounds

Added in 1.0.0
public final @NonNull Rect getBounds()

Rect describing the area of the feature on screen.

getTapAction

Added in 1.0.0
public final PendingIntent getTapAction()

PendingIntent to be used if the screen reader's user triggers a tap action.

getText

Added in 1.0.0
public final @NonNull ComplicationText getText()

ComplicationText associated with the region, to be read by the screen reader.

getTextAt

Added in 1.0.0
public final @NonNull CharSequence getTextAt(@NonNull Resources resources, @NonNull Instant instant)

Returns the text that should be displayed for the given timestamp.

Parameters
@NonNull Resources resources

Resources from the current android.content.Context

@NonNull Instant instant

the Instant at which to sample the text

hashCode

public int hashCode()