RenderParameters
class RenderParameters
Used to parameterize watch face rendering.
Watch face rendering is split up in a number of layers: the base layer WatchFaceLayer.BASE, the ComplicationSlots layer WatchFaceLayer.COMPLICATIONS, and the layer above the complicationSlots WatchFaceLayer.COMPLICATIONS_OVERLAY. These layers are always drawn in this order, one on top of the previous one. These are the layers that are used to render the watch face itself.
An additional layer, the highlight layer, can be drawn during editing the watch face to highlight different elements of the watch face, namely a set of ComplicationSlots (which may be a single ComplicationSlot) or the area of the watch face that is affected by a single user style setting.
The watch face should provide a way to highlight any of the above combinations so that its own editor, or the one provided by the Wear OS companion phone app is able to highlight the editable part of the watch face to the user. If an individual user style setting is meant to affect the entire watch face (e.g. an overall color setting),then the entire watch face should be highlighted.
The watch face layers and highlight layer can be configured independently, so that it is possible to draw only the highlight layer by passing an empty set of watchFaceLayers.
The semantics of rendering different layers is such that if each individual layer is rendered independently and the resulting images are composited with alpha blending, the result is identical to rendering all of the layers in a single request.
use Watch Face Format instead
Summary
Nested types |
|---|
|
This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
sealed class RenderParameters.HighlightedElementThis class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
object RenderParameters.HighlightedElement.AllComplicationSlots : RenderParameters.HighlightedElementThis object is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
|
This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
|
This class is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public companion properties |
|
|---|---|
RenderParameters |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public constructors |
|---|
This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public functions |
|
|---|---|
open operator Boolean |
This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
open Int |
This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public properties |
|
|---|---|
DrawMode |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
RenderParameters.HighlightLayer? |
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. |
Map<Int, TapEvent> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Set<WatchFaceLayer> |
This property is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead. |
Public companion properties
DEFAULT_INTERACTIVE
val DEFAULT_INTERACTIVE: RenderParameters
Default RenderParameters which draws everything in interactive mode.
Public constructors
RenderParameters
RenderParameters(
drawMode: DrawMode,
watchFaceLayers: Set<WatchFaceLayer>,
highlightLayer: RenderParameters.HighlightLayer? = null,
lastComplicationTapDownEvents: Map<Int, TapEvent> = emptyMap()
)
| Parameters | |
|---|---|
drawMode: DrawMode |
The overall drawing parameters based on system state. |
watchFaceLayers: Set<WatchFaceLayer> |
The parts of the watch face to draw. |
highlightLayer: RenderParameters.HighlightLayer? = null |
Optional |
lastComplicationTapDownEvents: Map<Int, TapEvent> = emptyMap() |
Map of |
Public functions
Public properties
drawMode
val drawMode: DrawMode
The overall drawing parameters based on system state.
highlightLayer
val highlightLayer: RenderParameters.HighlightLayer?
Optional HighlightLayer used by editors to visually highlight an aspect of the watch face. Rendered last on top of watchFaceLayers. If highlighting isn't needed this will be null.
isForScreenshot
val isForScreenshot: Boolean
Whether or not we're rendering for a screenshot. Some watch faces with animations may need to make adjustments when a screen shot is taken to achieve the best result.
Note Renderer.CanvasRenderer2 and Renderer.CanvasRenderer always use software rendering for screenshots.
lastComplicationTapDownEvents
val lastComplicationTapDownEvents: Map<Int, TapEvent>
Map of ComplicationSlot id to the latest TapType.DOWN that ComplicationSlot received, if any.
watchFaceLayers
val watchFaceLayers: Set<WatchFaceLayer>
The parts of the watch face to draw.