ComplicationSlotState


class ComplicationSlotState


A snapshot of the state of a watch face ComplicationSlot.

Summary

Public constructors

ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    defaultDataSourceType: ComplicationType,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle
)

This function is deprecated. defaultDataSourceType is depreciated

ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    nameResourceId: Int?,
    screenReaderNameResourceId: Int?
)
@ComplicationExperimental
ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    nameResourceId: Int?,
    screenReaderNameResourceId: Int?,
    edgeComplicationBoundingArc: BoundingArc?
)

Public functions

open operator Boolean
equals(other: Any?)
BoundingArc?

Describes the geometry of an edge complication if specified, or null otherwise.

open Int
open String

Public properties

Rect

Screen space bounds of the ComplicationSlot in pixels.

Int

The type of the complication's bounds.

Bundle

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

ComplicationType

The ComplicationType of the complication's current ComplicationData.

DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

ComplicationType

This property is deprecated. Use defaultDataSourcePolicy.systemDataSourceFallbackDefaultType instead

Boolean

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

Boolean

Whether or not the complication is currently enabled (i.e. it should be drawn.

Boolean

Whether or not the complication was initially enabled before considering any ComplicationSlotsOption whose ComplicationSlotOverlays may enable or disable complicationSlots.

Int?

The ID of a string resource (or null if absent) to identify the complication slot visually in an editor.

Int?

The ID of a string resource (or null if absent) to identify the complication slot in a screen reader.

List<ComplicationType>

The ComplicationTypes supported by this complication.

Public constructors

ComplicationSlotState

ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    defaultDataSourceType: ComplicationType,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle
)
Parameters
bounds: Rect

Screen space bounds of the ComplicationSlot in pixels.

boundsType: Int

The type of the complication's bounds.

supportedTypes: List<ComplicationType>

The ComplicationTypes supported by this complication.

defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

defaultDataSourceType: ComplicationType

The default ComplicationType for this complication.

isEnabled: Boolean

Whether or not the complication is currently enabled (i.e. it should be drawn).

isInitiallyEnabled: Boolean

Whether or not the complication was initially enabled before considering any ComplicationSlotsOption whose ComplicationSlotOverlays may enable or disable complicationSlots.

currentType: ComplicationType

The ComplicationType of the complication's current ComplicationData.

fixedComplicationDataSource: Boolean

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

complicationConfigExtras: Bundle

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

ComplicationSlotState

ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    nameResourceId: Int?,
    screenReaderNameResourceId: Int?
)
Parameters
bounds: Rect

Screen space bounds of the ComplicationSlot in pixels.

boundsType: Int

The type of the complication's bounds.

supportedTypes: List<ComplicationType>

The ComplicationTypes supported by this complication.

defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

isEnabled: Boolean

Whether or not the complication is currently enabled (i.e. it should be drawn).

isInitiallyEnabled: Boolean

Whether or not the complication was initially enabled before considering any ComplicationSlotsOption whose ComplicationSlotOverlays may enable or disable complicationSlots.

currentType: ComplicationType

The ComplicationType of the complication's current ComplicationData.

fixedComplicationDataSource: Boolean

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

complicationConfigExtras: Bundle

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

nameResourceId: Int?

The ID of a string resource (or null if absent) to visually identify the complication slot in an editor.

screenReaderNameResourceId: Int?

The ID of a string resource (or null if absent) to identify the complication slot in a screen reader.

ComplicationSlotState

@ComplicationExperimental
ComplicationSlotState(
    bounds: Rect,
    boundsType: Int,
    supportedTypes: List<ComplicationType>,
    defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy,
    isEnabled: Boolean,
    isInitiallyEnabled: Boolean,
    currentType: ComplicationType,
    fixedComplicationDataSource: Boolean,
    complicationConfigExtras: Bundle,
    nameResourceId: Int?,
    screenReaderNameResourceId: Int?,
    edgeComplicationBoundingArc: BoundingArc?
)
Parameters
bounds: Rect

Screen space bounds of the ComplicationSlot in pixels.

boundsType: Int

The type of the complication's bounds.

supportedTypes: List<ComplicationType>

The ComplicationTypes supported by this complication.

defaultDataSourcePolicy: DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

isEnabled: Boolean

Whether or not the complication is currently enabled (i.e. it should be drawn).

isInitiallyEnabled: Boolean

Whether or not the complication was initially enabled before considering any ComplicationSlotsOption whose ComplicationSlotOverlays may enable or disable complicationSlots.

currentType: ComplicationType

The ComplicationType of the complication's current ComplicationData.

fixedComplicationDataSource: Boolean

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

complicationConfigExtras: Bundle

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

nameResourceId: Int?

The ID of a string resource (or null if absent) to visually identify the complication slot in an editor.

screenReaderNameResourceId: Int?

The ID of a string resource (or null if absent) to identify the complication slot in a screen reader.

edgeComplicationBoundingArc: BoundingArc?

The BoundingArc describing the geometry of an edge complication if specified, or null otherwise.

Public functions

equals

open operator fun equals(other: Any?): Boolean

getBoundingArc

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

Describes the geometry of an edge complication if specified, or null otherwise.

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

bounds

Added in 1.0.0
val boundsRect

Screen space bounds of the ComplicationSlot in pixels.

boundsType

Added in 1.0.0
val boundsTypeInt

The type of the complication's bounds.

complicationConfigExtras

Added in 1.0.0
val complicationConfigExtrasBundle

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

currentType

Added in 1.0.0
val currentTypeComplicationType

The ComplicationType of the complication's current ComplicationData.

defaultDataSourcePolicy

Added in 1.0.0
val defaultDataSourcePolicyDefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

defaultDataSourceType

Added in 1.0.0
Deprecated in 1.1.0
val defaultDataSourceTypeComplicationType

The default ComplicationType for this complication.

fixedComplicationDataSource

Added in 1.0.0
val fixedComplicationDataSourceBoolean

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

isEnabled

Added in 1.0.0
val isEnabledBoolean

Whether or not the complication is currently enabled (i.e. it should be drawn.

isInitiallyEnabled

Added in 1.0.0
val isInitiallyEnabledBoolean

Whether or not the complication was initially enabled before considering any ComplicationSlotsOption whose ComplicationSlotOverlays may enable or disable complicationSlots.

nameResourceId

Added in 1.1.0
val nameResourceIdInt?

The ID of a string resource (or null if absent) to identify the complication slot visually in an editor. This is supposed to be short and without the word complication in it.

screenReaderNameResourceId

Added in 1.1.0
val screenReaderNameResourceIdInt?

The ID of a string resource (or null if absent) to identify the complication slot in a screen reader. This is supposed to be a complete sentence.

supportedTypes

Added in 1.0.0
val supportedTypesList<ComplicationType>

The ComplicationTypes supported by this complication.