Android 12 Developer Preview is here! Try it out, and give us your feedback!

Builder

class Builder
kotlin.Any
   ↳ androidx.wear.watchface.Complication.Builder

Builder for constructing Complications.

Summary

Public methods
Complication

Constructs the Complication.

Complication.Builder

Sets optional extras to be merged into the Intent sent when invoking the provider chooser activity.

Complication.Builder

Sets the initial ComplicationType to use with the initial complication provider.

Complication.Builder
setEnabled(enabled: Boolean)

Whether the complication is initially enabled or not (by default its enabled).

Complication.Builder
setFixedComplicationProvider(fixedComplicationProvider: Boolean)

Whether or not the complication is fixed (i.

Public methods

build

fun build(): Complication

Constructs the Complication.

setComplicationConfigExtras

fun setComplicationConfigExtras(extras: Bundle?): Complication.Builder

Sets optional extras to be merged into the Intent sent when invoking the provider chooser activity.

setDefaultProviderType

fun setDefaultProviderType(defaultProviderType: ComplicationType): Complication.Builder

Sets the initial ComplicationType to use with the initial complication provider. Note care should be taken to ensure defaultProviderType is compatible with the DefaultComplicationProviderPolicy.

setEnabled

fun setEnabled(enabled: Boolean): Complication.Builder

Whether the complication is initially enabled or not (by default its enabled). This can be overridden by ComplicationsUserStyleSetting.

setFixedComplicationProvider

fun setFixedComplicationProvider(fixedComplicationProvider: Boolean): Complication.Builder

Whether or not the complication is fixed (i.e. the user can't change it).