WatchState
class 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 |
|---|
This function is deprecated. WatchState constructors without watchFaceInstanceId are deprecated |
This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public properties |
|
|---|---|
Long |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
@Px Int |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Long |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Boolean |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Boolean |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
StateFlow<Int?> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
StateFlow<Boolean?> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
StateFlow<Boolean?> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Boolean |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
StateFlow<Boolean?> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
StateFlow<String> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public constructors
WatchState(
interruptionFilter: StateFlow<Int?>,
isAmbient: StateFlow<Boolean?>,
isBatteryLowAndNotCharging: StateFlow<Boolean?>,
isVisible: StateFlow<Boolean?>,
hasLowBitAmbient: Boolean,
hasBurnInProtection: Boolean,
analogPreviewReferenceTimeMillis: Long,
digitalPreviewReferenceTimeMillis: Long,
chinHeight: Int,
isHeadless: Boolean
)
WatchState
WatchState(
interruptionFilter: StateFlow<Int?>,
isAmbient: StateFlow<Boolean?>,
isBatteryLowAndNotCharging: StateFlow<Boolean?>,
isVisible: StateFlow<Boolean?>,
hasLowBitAmbient: Boolean,
hasBurnInProtection: Boolean,
analogPreviewReferenceTimeMillis: Long,
digitalPreviewReferenceTimeMillis: Long,
chinHeight: @Px Int,
isHeadless: Boolean,
watchFaceInstanceId: StateFlow<String>
)
| Parameters | |
|---|---|
interruptionFilter: StateFlow<Int?> |
The current user interruption settings. See |
isAmbient: StateFlow<Boolean?> |
Whether or not the watch is in ambient mode. This is initially |
isBatteryLowAndNotCharging: StateFlow<Boolean?> |
Whether or not we should conserve power due to a low battery which isn't charging. This is initially |
isVisible: StateFlow<Boolean?> |
Whether or not the watch face is visible. This is initially |
hasLowBitAmbient: Boolean |
Whether or not the watch hardware supports low bit ambient support. |
hasBurnInProtection: Boolean |
Whether or not the watch hardware supports burn in protection. |
analogPreviewReferenceTimeMillis: Long |
UTC reference time for previews of analog watch faces in milliseconds since the epoch. |
digitalPreviewReferenceTimeMillis: Long |
UTC reference time for previews of digital watch faces in milliseconds since the epoch. |
chinHeight: @Px Int |
the size, in pixels, of the chin or zero if the device does not have a chin. A chin is a section at the bottom of a circular display that is visible due to hardware limitations. |
isHeadless: Boolean |
Whether or not this is a headless watchface. |
watchFaceInstanceId: StateFlow<String> |
The ID associated with the watch face instance. Note there may be more than one instance associated with a @deprecated use Watch Face Format instead |
Public properties
analogPreviewReferenceTimeMillis
val analogPreviewReferenceTimeMillis: Long
UTC reference time for previews of analog watch faces in milliseconds since the epoch.
chinHeight
val chinHeight: @Px Int
the size, in pixels, of the chin or zero if the device does not have a chin. A chin is a section at the bottom of a circular display that is visible due to hardware limitations.
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: StateFlow<Int?>
The current user interruption settings. See NotificationManager. This is initially null because the watch face is created before the system has sent the state. 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: StateFlow<Boolean?>
Whether or not the watch is in ambient mode. This is initially null because the watch face is created before the system has sent the state. The order in which ambient vs style changes are reported is not guaranteed. Likewise the order of isAmbient flow callbacks and Renderer.CanvasRenderer.render or Renderer.GlesRenderer.render calls is not defined. For rendering please refer to RenderParameters.drawMode instead of isAmbient because you might receive requests for rendering non-ambient frames while the watch is ambient (e.g. editing from the companion phone).
isBatteryLowAndNotCharging
val isBatteryLowAndNotCharging: StateFlow<Boolean?>
Whether or not we should conserve power due to a low battery which isn't charging. This is initially null because the watch face is created before the system has sent the state. Only valid if android.support.wearable.watchface.WatchFaceStyle.hideNotificationIndicator is true.
isHeadless
val isHeadless: Boolean
Whether or not this is a headless watchface.
isVisible
val isVisible: StateFlow<Boolean?>
Whether or not the watch face is visible. This is initially null because the watch face is created before the system has sent the state.
watchFaceInstanceId
val watchFaceInstanceId: StateFlow<String>
The ID associated with the watch face instance. Note there may be more than one instance associated with a WatchFaceService. See androidx.wear.watchface.client.WatchFaceId for more details.
@deprecated use Watch Face Format instead