ComplicationSlotMetadata

public final class ComplicationSlotMetadata


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

Summary

Public constructors

ComplicationSlotMetadata(
    ComplicationSlotBounds bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isInitiallyEnabled,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras
)

Constructs a ComplicationSlotMetadata.

@ComplicationExperimental
ComplicationSlotMetadata(
    ComplicationSlotBounds bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isInitiallyEnabled,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    BoundingArc boundingArc
)

Public methods

final BoundingArc

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

final ComplicationSlotBounds

The complication slot's ComplicationSlotBounds.

final int

The ComplicationSlotBoundsTypeIntDef of the complication slot.

final @NonNull Bundle

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

final @NonNull DefaultComplicationDataSourcePolicy

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

final boolean

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

final @NonNull List<@NonNull ComplicationType>

The list of ComplicationTypes accepted by this complication slot.

final boolean

At creation a complication slot is either enabled or disabled.

Public constructors

ComplicationSlotMetadata

public ComplicationSlotMetadata(
    ComplicationSlotBounds bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isInitiallyEnabled,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras
)

Constructs a ComplicationSlotMetadata.

Parameters
ComplicationSlotBounds bounds

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

int boundsType

The ComplicationSlotBoundsTypeIntDef of the complication slot.

@NonNull List<@NonNull ComplicationType> supportedTypes

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

@NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy

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

boolean isInitiallyEnabled

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.

boolean fixedComplicationDataSource

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.

@NonNull Bundle complicationConfigExtras

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

ComplicationSlotMetadata

@ComplicationExperimental
public ComplicationSlotMetadata(
    ComplicationSlotBounds bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isInitiallyEnabled,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    BoundingArc boundingArc
)

Public methods

getBoundingArc

Added in 1.2.0
@ComplicationExperimental
public final BoundingArc getBoundingArc()

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

getBounds

Added in 1.1.0
public final ComplicationSlotBounds getBounds()

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

getBoundsType

Added in 1.1.0
public final int getBoundsType()

The ComplicationSlotBoundsTypeIntDef of the complication slot.

getComplicationConfigExtras

Added in 1.1.0
public final @NonNull Bundle getComplicationConfigExtras()

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

getDefaultDataSourcePolicy

Added in 1.1.0
public final @NonNull DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy()

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

getFixedComplicationDataSource

Added in 1.1.0
public final boolean getFixedComplicationDataSource()

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.

getSupportedTypes

Added in 1.1.0
public final @NonNull List<@NonNull ComplicationTypegetSupportedTypes()

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

isInitiallyEnabled

Added in 1.1.0
public final boolean isInitiallyEnabled()

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.