Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

WatchFace

class WatchFace
kotlin.Any
   ↳ androidx.wear.watchface.WatchFace

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

Summary

Nested classes

Legacy Wear 2.

abstract

Interface for getting the current system time.

abstract

Listens for taps on the watchface which didn't land on Complications.

Public constructors
<init>(watchFaceType: Int, userStyleRepository: UserStyleRepository, complicationsManager: ComplicationsManager, renderer: Renderer)

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

Public methods
WatchFace

Sets the legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.

WatchFace
setOverridePreviewReferenceTimeMillis(@IntRange(0) previewReferenceTimeMillis: Long)

Overrides the reference time for editor preview images.

WatchFace

WatchFace

Sets an optional TapListener which if not null gets called on the ui thread whenever the user taps on the watchface but doesn't hit a Complication.

Companion functions
Boolean

Returns whether LegacyWatchFaceOverlayStyle is supported on this device.

Properties
WatchFace.LegacyWatchFaceOverlayStyle

The legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.

Long?

The UTC preview time in milliseconds since the epoch, or null if not set.

Public constructors

<init>

WatchFace(
    watchFaceType: Int,
    userStyleRepository: UserStyleRepository,
    complicationsManager: ComplicationsManager,
    renderer: Renderer)

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

Public methods

setLegacyWatchFaceStyle

fun setLegacyWatchFaceStyle(legacyWatchFaceStyle: WatchFace.LegacyWatchFaceOverlayStyle): WatchFace

Sets the legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.0 devices.

setOverridePreviewReferenceTimeMillis

fun setOverridePreviewReferenceTimeMillis(@IntRange(0) previewReferenceTimeMillis: Long): WatchFace

Overrides the reference time for editor preview images.

Parameters
previewReferenceTimeMillis: Long The UTC preview time in milliseconds since the epoch

setSystemTimeProvider

fun setSystemTimeProvider(systemTimeProvider: WatchFace.SystemTimeProvider): WatchFace

setTapListener

fun setTapListener(tapListener: WatchFace.TapListener?): WatchFace

Sets an optional TapListener which if not null gets called on the ui thread whenever the user taps on the watchface but doesn't hit a Complication.

Properties

legacyWatchFaceStyle

var legacyWatchFaceStyle: WatchFace.LegacyWatchFaceOverlayStyle

The legacy LegacyWatchFaceOverlayStyle which only affects Wear 2.0 devices.

overridePreviewReferenceTimeMillis

var overridePreviewReferenceTimeMillis: Long?

The UTC preview time in milliseconds since the epoch, or null if not set.

Companion functions

isLegacyWatchFaceOverlayStyleSupported

@JvmStatic fun isLegacyWatchFaceOverlayStyleSupported(): Boolean

Returns whether LegacyWatchFaceOverlayStyle is supported on this device.