ComplicationSlot.Builder

public final class ComplicationSlot.Builder


Builder for constructing ComplicationSlots.

Summary

Public methods

final @NonNull ComplicationSlot

Constructs the ComplicationSlot.

final @NonNull ComplicationSlot.Builder
setAccessibilityTraversalIndex(int accessibilityTraversalIndex)

Sets the initial value used to sort Complications when generating accessibility content description labels.

final @NonNull ComplicationSlot.Builder

Sets optional extras to be merged into the Intent sent when invoking the complication data source chooser activity.

final @NonNull ComplicationSlot.Builder
setDefaultDataSourceType(
    @NonNull ComplicationType defaultDataSourceType
)

Sets the initial ComplicationType to use with the initial complication data source.

final @NonNull ComplicationSlot.Builder
setEnabled(boolean enabled)

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

final @NonNull ComplicationSlot.Builder
setFixedComplicationDataSource(boolean fixedComplicationDataSource)

Whether or not the complication source is fixed (i.e.

Public methods

build

@NonNull
public final ComplicationSlot build()

Constructs the ComplicationSlot.

setAccessibilityTraversalIndex

@NonNull
public final ComplicationSlot.Builder setAccessibilityTraversalIndex(int accessibilityTraversalIndex)

Sets the initial value used to sort Complications when generating accessibility content description labels. By default this is id.

setConfigExtras

@NonNull
public final ComplicationSlot.Builder setConfigExtras(@NonNull Bundle extras)

Sets optional extras to be merged into the Intent sent when invoking the complication data source chooser activity.

setDefaultDataSourceType

@NonNull
public final ComplicationSlot.Builder setDefaultDataSourceType(
    @NonNull ComplicationType defaultDataSourceType
)

Sets the initial ComplicationType to use with the initial complication data source. Note care should be taken to ensure defaultDataSourceType is compatible with the DefaultComplicationDataSourcePolicy.

setEnabled

@NonNull
public final ComplicationSlot.Builder setEnabled(boolean enabled)

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

setFixedComplicationDataSource

@NonNull
public final ComplicationSlot.Builder setFixedComplicationDataSource(boolean fixedComplicationDataSource)

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