ComplicationSlotMetadata


class ComplicationSlotMetadata


Static metadata for a androidx.wear.watchface.ComplicationSlot.

Summary

Public constructors

ComplicationSlotMetadata(
    bounds: ComplicationSlotBounds?,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isInitiallyEnabled: Boolean,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle
)

Constructs a ComplicationSlotMetadata.

@ComplicationExperimental
ComplicationSlotMetadata(
    bounds: ComplicationSlotBounds?,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isInitiallyEnabled: Boolean,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    boundingArc: BoundingArc?
)

Public functions

BoundingArc?

The optional BoundingArc for an edge complication if specified, or null otherwise.

Public properties

ComplicationSlotBounds?

The complication slot's ComplicationSlotBounds.

Int

The ComplicationSlotBoundsTypeIntDef of the complication slot.

Bundle

Extras to be merged into the Intent sent when invoking the complication data source chooser activity.

DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy which controls the initial complication data source when the watch face is first installed.

Boolean

Whether or not the complication slot's complication data source is fixed (i.e. can't be changed by the user).

Boolean

At creation a complication slot is either enabled or disabled.

List<ComplicationType>

The list of ComplicationTypes accepted by this complication slot.

Public constructors

ComplicationSlotMetadata

ComplicationSlotMetadata(
    bounds: ComplicationSlotBounds?,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isInitiallyEnabled: Boolean,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle
)

Constructs a ComplicationSlotMetadata.

Parameters
bounds: ComplicationSlotBounds?

The complication slot's ComplicationSlotBounds. Only non null for watch faces with a new enough androidx.wear.watchface.control.WatchFaceControlService.

boundsType: Int

The ComplicationSlotBoundsTypeIntDef of the complication slot.

supportedTypes: List<ComplicationType>

The list of ComplicationTypes accepted by this complication slot. Used during complication data source selection, this list should be non-empty.

defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy which controls the initial complication data source when the watch face is first installed.

isInitiallyEnabled: Boolean

At creation a complication slot is either enabled or disabled. This can be overridden by a ComplicationSlotsUserStyleSetting (see ComplicationSlotOverlay.enabled). Editors need to know the initial state of a complication slot to predict the effects of making a style change.

fixedComplicationDataSource: Boolean

Whether or not the complication slot's complication data source is fixed (i.e. can't be changed by the user). This is useful for watch faces built around specific complication complication data sources.

complicationConfigExtras: Bundle

Extras to be merged into the Intent sent when invoking the complication data source chooser activity.

ComplicationSlotMetadata

@ComplicationExperimental
ComplicationSlotMetadata(
    bounds: ComplicationSlotBounds?,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isInitiallyEnabled: Boolean,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    boundingArc: BoundingArc?
)

Public functions

getBoundingArc

Added in 1.2.0
@ComplicationExperimental
fun getBoundingArc(): BoundingArc?

The optional BoundingArc for an edge complication if specified, or null otherwise.

Public properties

bounds

Added in 1.1.0
val boundsComplicationSlotBounds?

The complication slot's ComplicationSlotBounds. Only non null for watch faces with a new enough androidx.wear.watchface.control.WatchFaceControlService.

boundsType

Added in 1.1.0
val boundsTypeInt

The ComplicationSlotBoundsTypeIntDef of the complication slot.

complicationConfigExtras

Added in 1.1.0
val complicationConfigExtrasBundle

Extras to be merged into the Intent sent when invoking the complication data source chooser activity.

defaultDataSourcePolicy

Added in 1.1.0
val defaultDataSourcePolicyDefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy which controls the initial complication data source when the watch face is first installed.

fixedComplicationDataSource

Added in 1.1.0
val fixedComplicationDataSourceBoolean

Whether or not the complication slot's complication data source is fixed (i.e. can't be changed by the user). This is useful for watch faces built around specific complication complication data sources.

isInitiallyEnabled

Added in 1.1.0
val isInitiallyEnabledBoolean

At creation a complication slot is either enabled or disabled. This can be overridden by a ComplicationSlotsUserStyleSetting (see ComplicationSlotOverlay.enabled). Editors need to know the initial state of a complication slot to predict the effects of making a style change.

supportedTypes

Added in 1.1.0
val supportedTypesList<ComplicationType>

The list of ComplicationTypes accepted by this complication slot. Used during complication data source selection, this list should be non-empty.