ComplicationSlotConfig.Builder

public static final class ComplicationSlotConfig.Builder
extends Object

java.lang.Object
   ↳ com.google.wear.services.complications.ComplicationSlotConfig.Builder


Builder for ComplicationSlotConfig.

Summary

Public constructors

Builder(ComplicationSlotConfig complicationSlotConfig)

Creates a Builder for a ComplicationSlotConfig using an existing ComplicationSlotConfig as seed.

Builder(int id, WatchFaceId watchFaceId, int watchFaceSlotId)

Creates a Builder for a ComplicationSlotConfig using a WatchFaceId and a watchFaceSlotId as seed.

Public methods

ComplicationSlotConfig build()

Creates a new ComplicationSlotConfig object from the builder with the set parameters.

ComplicationSlotConfig.Builder setDataType(int dataType)

Sets the type of complication data that should be provided.

ComplicationSlotConfig.Builder setProviderComponent(ComponentName providerComponent)

Sets the ComponentName of the ComplicationDataSourceService selected to supply ComplicationData for this complication.

Inherited methods

Public constructors

Builder

Added in version 35.1
public Builder (ComplicationSlotConfig complicationSlotConfig)

Creates a Builder for a ComplicationSlotConfig using an existing ComplicationSlotConfig as seed.

Parameters
complicationSlotConfig ComplicationSlotConfig

Builder

Added in version 35.1
public Builder (int id, 
                WatchFaceId watchFaceId, 
                int watchFaceSlotId)

Creates a Builder for a ComplicationSlotConfig using a WatchFaceId and a watchFaceSlotId as seed.

Parameters
id int

watchFaceId WatchFaceId

watchFaceSlotId int

Public methods

build

Added in version 35.1
public ComplicationSlotConfig build ()

Creates a new ComplicationSlotConfig object from the builder with the set parameters.

Returns
ComplicationSlotConfig

setDataType

Added in version 35.1
public ComplicationSlotConfig.Builder setDataType (int dataType)

Sets the type of complication data that should be provided.

Parameters
dataType int: Value is one of the following:

Returns
ComplicationSlotConfig.Builder

setProviderComponent

Added in version 35.1
public ComplicationSlotConfig.Builder setProviderComponent (ComponentName providerComponent)

Sets the ComponentName of the ComplicationDataSourceService selected to supply ComplicationData for this complication.

This value should be null if the slot is empty, i.e. ComplicationSlotConfig.getDataType() is NOT_CONFIGURED or EMPTY.

Parameters
providerComponent ComponentName

Returns
ComplicationSlotConfig.Builder