ComplicationSlot.Builder


class ComplicationSlot.Builder


Builder for constructing ComplicationSlots.

Summary

Public functions

ComplicationSlot

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder
setAccessibilityTraversalIndex(accessibilityTraversalIndex: Int)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder

This function is deprecated. Instead set DefaultComplicationDataSourcePolicy.systemDataSourceFallbackDefaultType.

ComplicationSlot.Builder
setEnabled(enabled: Boolean)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder
setFixedComplicationDataSource(fixedComplicationDataSource: Boolean)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder
setNameResourceId(nameResourceId: Int?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

ComplicationSlot.Builder
setScreenReaderNameResourceId(screenReaderNameResourceId: Int?)

This function is deprecated. AndroidX watchface libraries are deprecated, use Watch Face Format instead.

Public functions

build

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun build(): ComplicationSlot

Constructs the ComplicationSlot.

setAccessibilityTraversalIndex

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun setAccessibilityTraversalIndex(accessibilityTraversalIndex: Int): ComplicationSlot.Builder

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

setConfigExtras

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun setConfigExtras(extras: Bundle): ComplicationSlot.Builder

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

setDefaultDataSourceType

Added in 1.0.0
Deprecated in 1.1.0
fun setDefaultDataSourceType(defaultDataSourceType: ComplicationType): ComplicationSlot.Builder

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

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun setEnabled(enabled: Boolean): ComplicationSlot.Builder

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

setFixedComplicationDataSource

Added in 1.0.0
Deprecated in 1.3.0-alpha06
fun setFixedComplicationDataSource(fixedComplicationDataSource: Boolean): ComplicationSlot.Builder

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

setNameResourceId

Added in 1.1.0
Deprecated in 1.3.0-alpha06
fun setNameResourceId(nameResourceId: Int?): ComplicationSlot.Builder

If non-null sets the ID of a string resource containing the name of this complication slot, for use visually in an editor. This resource should be short and should not contain the word "Complication". E.g. "Left" for the left complication.

setScreenReaderNameResourceId

Added in 1.1.0
Deprecated in 1.3.0-alpha06
fun setScreenReaderNameResourceId(screenReaderNameResourceId: Int?): ComplicationSlot.Builder

If non-null sets the ID of a string resource containing the name of this complication slot, for use by a screen reader. This resource should be a short sentence. E.g. "Left complication" for the left complication.