Google is committed to advancing racial equity for Black communities. See how.

WatchFaceConfigDelegate

interface WatchFaceConfigDelegate
androidx.wear.watchface.ui.WatchFaceConfigDelegate

Interface for communication with the watch face.

Summary

Public methods
abstract Unit

Requests that the specified complication is highlighted for a short duration.

abstract Int?

Returns the id of the background complication or null if there isn't one.

abstract Calendar

Returns the current Calendar.

abstract Int?
getComplicationIdAt(tapX: Int, tapY: Int)

Returns the id of the complication at the given coordinates.

abstract Map<Int, Complication>

Returns a map of complication IDs to complications.

abstract UserStyleWireFormat

Returns the current user style.

abstract UserStyleSchemaWireFormat

Returns the style schema.

abstract Unit
setUserStyle(userStyle: UserStyleWireFormat)

Sets the user style map.

abstract Bitmap
takeScreenshot(drawRect: Rect, calendar: Calendar, renderParameters: RenderParametersWireFormat)

Requests a screenshot of the watch face.

Public methods

brieflyHighlightComplicationId

abstract fun brieflyHighlightComplicationId(complicationId: Int): Unit

Requests that the specified complication is highlighted for a short duration.

getBackgroundComplicationId

abstract fun getBackgroundComplicationId(): Int?

Returns the id of the background complication or null if there isn't one.

getCalendar

abstract fun getCalendar(): Calendar

Returns the current Calendar.

getComplicationIdAt

abstract fun getComplicationIdAt(
    tapX: Int,
    tapY: Int
): Int?

Returns the id of the complication at the given coordinates.

getComplicationsMap

abstract fun getComplicationsMap(): Map<Int, Complication>

Returns a map of complication IDs to complications.

TODO(alexclarke): These should be passed as bundles.

getUserStyle

abstract fun getUserStyle(): UserStyleWireFormat

Returns the current user style.

getUserStyleSchema

abstract fun getUserStyleSchema(): UserStyleSchemaWireFormat

Returns the style schema.

setUserStyle

abstract fun setUserStyle(userStyle: UserStyleWireFormat): Unit

Sets the user style map.

takeScreenshot

abstract fun takeScreenshot(
    drawRect: Rect,
    calendar: Calendar,
    renderParameters: RenderParametersWireFormat
): Bitmap

Requests a screenshot of the watch face.