RemoteWatchFaceViewHost


Note: As of July 10, 2024, watch faces must use the Watch Face Format in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about the user-facing changes in this Help Center article.

Additionally, starting in early 2025 (specific date to be announced during Q4 2024), all new watch faces published on Google Play must use the Watch Face Format.

public interface RemoteWatchFaceViewHost extends 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 methods

abstract @NonNull SurfaceControlViewHost.SurfacePackage

The SurfaceControlViewHost.SurfacePackage the client should attach to a SurfaceView via SurfaceView.setChildSurfacePackage.

abstract void
renderWatchFace(
    @NonNull RenderParameters renderParameters,
    @NonNull Instant instant,
    UserStyle userStyle,
    Map<@NonNull Integer, @NonNull ComplicationData> idAndComplicationData
)

Renders the watchface into the view associated with surfacePackage.

Inherited methods

From java.lang.AutoCloseable
abstract void

Public methods

getSurfacePackage

Added in 1.2.0
abstract @NonNull SurfaceControlViewHost.SurfacePackage getSurfacePackage()

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.

renderWatchFace

abstract void renderWatchFace(
    @NonNull RenderParameters renderParameters,
    @NonNull Instant instant,
    UserStyle userStyle,
    Map<@NonNull Integer, @NonNull ComplicationData> idAndComplicationData
)

Renders the watchface into the view associated with surfacePackage.

Parameters
@NonNull RenderParameters renderParameters

The RenderParameters to draw with.

@NonNull Instant instant

The Instant render with.

UserStyle userStyle

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

Map<@NonNull Integer, @NonNull ComplicationData> idAndComplicationData

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