RemoteWatchFaceViewHost


interface RemoteWatchFaceViewHost : AutoCloseable


Intended for use by watch face editors, a RemoteWatchFaceViewHost allows the watch face to send a SurfaceControlViewHost.SurfacePackage to the client, which the client can attach to a SurfaceView with SurfaceView.setChildSurfacePackage. The client can request an updated screen shot by calling renderWatchFace.

Summary

Public functions

Unit
renderWatchFace(
    renderParameters: RenderParameters,
    instant: Instant,
    userStyle: UserStyle?,
    idAndComplicationData: Map<IntComplicationData>?
)

Renders the watchface into the view associated with surfacePackage.

Inherited functions

From java.lang.AutoCloseable

Public functions

renderWatchFace

fun renderWatchFace(
    renderParameters: RenderParameters,
    instant: Instant,
    userStyle: UserStyle?,
    idAndComplicationData: Map<IntComplicationData>?
): Unit

Renders the watchface into the view associated with surfacePackage.

Parameters
renderParameters: RenderParameters

The RenderParameters to draw with.

instant: Instant

The Instant render with.

userStyle: UserStyle?

Optional UserStyle to render with, if null the current style is used.

idAndComplicationData: Map<IntComplicationData>?

Map of complication ids to ComplicationData to render with, or if null then the existing complication data if any is used.

Public properties

surfacePackage

Added in 1.2.0
val surfacePackageSurfaceControlViewHost.SurfacePackage

The SurfaceControlViewHost.SurfacePackage the client should attach to a SurfaceView via SurfaceView.setChildSurfacePackage. The watch face will render into this view when renderWatchFace is called.