getPeekCardPosition

Returns the location of the first peeking card. This doesn't provide information about all
movements of the card, only about its location when it's peeking at the bottom and allowing
the watch face to be exposed.

onPeekCardPositionUpdate

Called when the first, peeking card positions itself on the screen. This is where the watch
face can change its appearance depending on where the card is on the screen. This doesn't
provide information about all movements of the card, only about its location when it's
peeking at the bottom and allowing the watch face to be exposed.

onUnreadCountChanged

Called when the number of unread notification cards in the stream has changed.

Parameters

count

int: number of the notification cards in the stream that haven't yet been seen by the
user

onVisibilityChanged

void onVisibilityChanged (boolean visible)

Called to inform you of the watch face becoming visible or hidden. If you decide to override
this method, you must call super.onVisibilityChanged(visible) as the first
statement in your override.

Parameters

visible

boolean

setActiveComplications

void setActiveComplications (int... watchFaceComplicationIds)

Sets the complications which are active in the watchface. Complication data will be received
for these ids.

Any ids not in the provided ids will be considered inactive.

If providers and complication data types have been configured, the data received will
match the type chosen by the user. If no provider has been configured, data of type TYPE_NOT_CONFIGURED will be received.

Ids here are chosen by the watch face to represent each complication and can be any
integer.

Parameters

watchFaceComplicationIds

int

setDefaultComplicationProvider

Sets a custom provider as the default provider for the specified watch face complication id.
This may be used to set a non-system provider as a default, if the component name of the
provider is known. To set a system provider as a default, use setDefaultSystemComplicationProvider(int, int, int) instead.

This will do nothing if the provider is not installed, or if the specified type is not
supported by the provider, or if the user has already selected a provider for the
complication.

Note that if the watch face has not yet been granted the RECEIVE_COMPLICATION_DATA
permission, it will not be able to receive data from the provider unless the provider is from
the same app package as the watch face, or the provider lists the watch face as a safe watch
face. For system providers that may be used before your watch face has the permission, use
setDefaultSystemComplicationProvider(int, int, int) with a safe provider instead.

A provider not satisfying the above conditions may still be set as a default using this
method, but the watch face will receive dummy data of type TYPE_NO_PERMISSION until the permission has been granted.

To set an 'empty' default, this method may be used with provider equal to null,
and type equal to TYPE_EMPTY. It is not required
to do this for all complications - any complications with no default set and no user-selected
provider will receive data of TYPE_NOT_CONFIGURED.

This will do nothing if the provider is not installed, or if the specified type is not
supported by the provider, or if the user has already selected a provider for the
complication.

Note that if the watch face has not yet been granted the RECEIVE_COMPLICATION_DATA
permission, it will not be able to receive data from the provider unless it is a safe
provider (see the provider descriptions in the SystemProviders class).

A non-safe provider may still be set as a default using this method, but the watch face
will receive dummy data of type TYPE_NO_PERMISSION until the
permission has been granted.

It is not required to do this for all complications - any complications with no default
set and no user-selected provider will receive data of TYPE_NOT_CONFIGURED.

setWatchFaceStyle

Sets the watch face style. This affects how UI elements such as the battery indicator are
drawn on top of the watch face. Typically called in onCreate(SurfaceHolder) but may be called at
any time, e.g. in response to the user changing the watch face configuration. Must be called
from the wallpaper thread.