Android 12 Developer Preview is here! Try it out, and give us your feedback!

WatchState

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

Describes the current state of the wearable including some hardware details such as whether or not it supports burn in prevention and low-bit ambient.

Summary

Public constructors
<init>(interruptionFilter: ObservableWatchData<Int>, isAmbient: ObservableWatchData<Boolean>, isBatteryLowAndNotCharging: ObservableWatchData<Boolean>, isVisible: ObservableWatchData<Boolean>, hasLowBitAmbient: Boolean, hasBurnInProtection: Boolean, analogPreviewReferenceTimeMillis: Long, digitalPreviewReferenceTimeMillis: Long, isHeadless: Boolean)

Describes the current state of the wearable including some hardware details such as whether or not it supports burn in prevention and low-bit ambient.

Properties
Long

UTC reference time for previews of analog watch faces in milliseconds since the epoch.

Long

UTC reference time for previews of digital watch faces in milliseconds since the epoch.

Boolean

Whether or not the watch hardware supports burn in protection.

Boolean

Whether or not the watch hardware supports low bit ambient support.

ObservableWatchData<Int>

The current user interruption settings.

ObservableWatchData<Boolean>

Whether or not the watch is in ambient mode.

ObservableWatchData<Boolean>

Whether or not we should conserve power due to a low battery which isn't charging.

Boolean

Whether or not this is a headless watchface.

ObservableWatchData<Boolean>

Whether or not the watch face is visible.

Public constructors

<init>

WatchState(
    interruptionFilter: ObservableWatchData<Int>,
    isAmbient: ObservableWatchData<Boolean>,
    isBatteryLowAndNotCharging: ObservableWatchData<Boolean>,
    isVisible: ObservableWatchData<Boolean>,
    hasLowBitAmbient: Boolean,
    hasBurnInProtection: Boolean,
    analogPreviewReferenceTimeMillis: Long,
    digitalPreviewReferenceTimeMillis: Long,
    isHeadless: Boolean)

Describes the current state of the wearable including some hardware details such as whether or not it supports burn in prevention and low-bit ambient.

Properties

analogPreviewReferenceTimeMillis

val analogPreviewReferenceTimeMillis: Long

UTC reference time for previews of analog watch faces in milliseconds since the epoch.

digitalPreviewReferenceTimeMillis

val digitalPreviewReferenceTimeMillis: Long

UTC reference time for previews of digital watch faces in milliseconds since the epoch.

hasBurnInProtection

val hasBurnInProtection: Boolean

Whether or not the watch hardware supports burn in protection.

hasLowBitAmbient

val hasLowBitAmbient: Boolean

Whether or not the watch hardware supports low bit ambient support.

interruptionFilter

val interruptionFilter: ObservableWatchData<Int>

The current user interruption settings. See NotificationManager. Based on the value the watch face should adjust the amount of information it displays. For example, if it displays the number of pending emails, it should hide it if interruptionFilter is equal to