ContentDescriptionLabel

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()