Google is committed to advancing racial equity for Black communities. See how.

WatchState

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

Summary

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

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.

ObservableWatchData<Boolean>

Whether or not the watch face is visible.

Int

The physical shape of the screen.

Public constructors

<init>

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

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 NotificationManager.INTERRUPTION_FILTER_NONE. interruptionFilter can be NotificationManager.INTERRUPTION_FILTER_NONE, NotificationManager.INTERRUPTION_FILTER_PRIORITY, NotificationManager.INTERRUPTION_FILTER_ALL, NotificationManager.INTERRUPTION_FILTER_ALARMS, or NotificationManager.INTERRUPTION_FILTER_UNKNOWN.

isAmbient

val isAmbient: ObservableWatchData<Boolean>

Whether or not the watch is in ambient mode. The watch face should switch to a simplified low intensity display when in ambient mode. E.g. if the watch face displays seconds, it should hide them in ambient mode.

isBatteryLowAndNotCharging

val isBatteryLowAndNotCharging: ObservableWatchData<Boolean>

Whether or not we should conserve power due to a low battery which isn't charging. Only valid if android.support.wearable.watchface.WatchFaceStyle.hideNotificationIndicator is true.

isVisible

val isVisible: ObservableWatchData<Boolean>

Whether or not the watch face is visible.

screenShape

val screenShape: Int

The physical shape of the screen.