WatchFace

public final class WatchFace


The return value of WatchFaceService.createWatchFace which brings together rendering, styling, complicationSlots and state observers.

Summary

Nested types

WatchFace.Companion
WatchFace.LegacyWatchFaceOverlayStyle

Legacy Wear 2.0 watch face styling.

WatchFace.PendingIntentTapListener

Listens for taps on the watchface and optionally returns a PendingIntent.

WatchFace.TapListener

Listens for taps on the watchface.

Public fields

final @NonNull WatchFace.LegacyWatchFaceOverlayStyle

The legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.0 devices.

final Instant

The Instant to use for preview rendering, or null if not set in which case the system chooses the Instant to use.

final @NonNull Renderer

The Renderer for this WatchFace.

final int

The type of watch face, whether it's digital or analog.

Public constructors

WatchFace(@WatchFaceType int watchFaceType, Renderer renderer)

Public methods

final @NonNull WatchFace
setComplicationDeniedDialogIntent(
    Intent complicationDeniedDialogIntent
)

Sets the Intent to launch an activity which explains the watch face needs permission to display complications.

final @NonNull WatchFace
setComplicationRationaleDialogIntent(
    Intent complicationRationaleDialogIntent
)

Sets the Intent to launch an activity that explains the rational for the requesting the com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATApermission prior to requesting it, if [Activity.shouldShowRequestPermissionRationale] returns true`.

final @NonNull WatchFace

Sets the legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.0 devices.

final @NonNull WatchFace
setOverridePreviewReferenceInstant(Instant previewReferenceTimeMillis)

Overrides the reference time for editor preview images.

final @NonNull WatchFace

Sets an optional TapListener which if not null gets called on the ui thread whenever the user taps on the watchface.

final @