ContentDescriptionLabel

public final class ContentDescriptionLabel


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

Summary

Public fields

final @NonNull Rect

Rect describing the area of the feature on screen.

final @Nullable 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.

Public constructors

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

Public methods

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

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

int

Public fields

bounds

@NonNull
public final @NonNull Rect bounds

Rect describing the area of the feature on screen.

tapAction

@Nullable
public final @Nullable PendingIntent tapAction

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

text

@NonNull
public final @NonNull ComplicationText text

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

Public constructors

ContentDescriptionLabel

public final ContentDescriptionLabel(
    @NonNull ComplicationText text,
    @NonNull Rect bounds,
    @Nullable 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.

@Nullable PendingIntent tapAction

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

Public methods

equals

@NonNull
public boolean equals(@Nullable Object other)

getTextAt

@NonNull
public final 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

@NonNull
public int hashCode()