ComplicationSlotState

public final class ComplicationSlotState


A snapshot of the state of a watch face ComplicationSlot.

Summary

Public constructors

ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    @NonNull ComplicationType defaultDataSourceType,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras
)

This method is deprecated. defaultDataSourceType is depreciated

ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    Integer nameResourceId,
    Integer screenReaderNameResourceId
)
@ComplicationExperimental
ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    Integer nameResourceId,
    Integer screenReaderNameResourceId,
    BoundingArc edgeComplicationBoundingArc
)

Public methods

boolean
equals(Object other)
final BoundingArc

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

final @NonNull Rect

Screen space bounds of the ComplicationSlot in pixels.

final int

The type of the complication's bounds.

final @NonNull Bundle

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

final @NonNull ComplicationType

The ComplicationType of the complication's current ComplicationData.

final @NonNull DefaultComplicationDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

final @NonNull ComplicationType

The default ComplicationType for this complication.

final boolean

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

final Integer

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

final Integer

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

final @NonNull List<@NonNull ComplicationType>

The ComplicationTypes supported by this complication.

int
final boolean

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

final boolean

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

@NonNull String

Public constructors

ComplicationSlotState

public ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    @NonNull ComplicationType defaultDataSourceType,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras
)
Parameters
@NonNull Rect bounds

Screen space bounds of the ComplicationSlot in pixels.

int boundsType

The type of the complication's bounds.

@NonNull List<@NonNull ComplicationType> supportedTypes

The ComplicationTypes supported by this complication.

@NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

@NonNull ComplicationType defaultDataSourceType

The default ComplicationType for this complication.

boolean isEnabled

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

boolean isInitiallyEnabled

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

@NonNull ComplicationType currentType

The ComplicationType of the complication's current ComplicationData.

boolean fixedComplicationDataSource

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

@NonNull Bundle complicationConfigExtras

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

ComplicationSlotState

public ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    Integer nameResourceId,
    Integer screenReaderNameResourceId
)
Parameters
@NonNull Rect bounds

Screen space bounds of the ComplicationSlot in pixels.

int boundsType

The type of the complication's bounds.

@NonNull List<@NonNull ComplicationType> supportedTypes

The ComplicationTypes supported by this complication.

@NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

boolean isEnabled

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

boolean isInitiallyEnabled

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

@NonNull ComplicationType currentType

The ComplicationType of the complication's current ComplicationData.

boolean fixedComplicationDataSource

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

@NonNull Bundle complicationConfigExtras

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

Integer nameResourceId

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

Integer screenReaderNameResourceId

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

ComplicationSlotState

@ComplicationExperimental
public ComplicationSlotState(
    @NonNull Rect bounds,
    int boundsType,
    @NonNull List<@NonNull ComplicationType> supportedTypes,
    @NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
    boolean isEnabled,
    boolean isInitiallyEnabled,
    @NonNull ComplicationType currentType,
    boolean fixedComplicationDataSource,
    @NonNull Bundle complicationConfigExtras,
    Integer nameResourceId,
    Integer screenReaderNameResourceId,
    BoundingArc edgeComplicationBoundingArc
)
Parameters
@NonNull Rect bounds

Screen space bounds of the ComplicationSlot in pixels.

int boundsType

The type of the complication's bounds.

@NonNull List<@NonNull ComplicationType> supportedTypes

The ComplicationTypes supported by this complication.

@NonNull DefaultComplicationDataSourcePolicy defaultDataSourcePolicy

The DefaultComplicationDataSourcePolicy for this complication slot.

boolean isEnabled

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

boolean isInitiallyEnabled

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

@NonNull ComplicationType currentType

The ComplicationType of the complication's current ComplicationData.

boolean fixedComplicationDataSource

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

@NonNull Bundle complicationConfigExtras

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

Integer nameResourceId

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

Integer screenReaderNameResourceId

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

BoundingArc edgeComplicationBoundingArc

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

Public methods

equals

public boolean equals(Object other)

getBoundingArc

Added in 1.2.0
@ComplicationExperimental
public final BoundingArc getBoundingArc()

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

getBounds

Added in 1.0.0
public final @NonNull Rect getBounds()

Screen space bounds of the ComplicationSlot in pixels.

getBoundsType

Added in 1.0.0
public final int getBoundsType()

The type of the complication's bounds.

getComplicationConfigExtras

Added in 1.0.0
public final @NonNull Bundle getComplicationConfigExtras()

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

getCurrentType

Added in 1.0.0
public final @NonNull ComplicationType getCurrentType()

The ComplicationType of the complication's current ComplicationData.

getDefaultDataSourcePolicy

Added in 1.0.0
public final @NonNull DefaultComplicationDataSourcePolicy getDefaultDataSourcePolicy()

The DefaultComplicationDataSourcePolicy for this complication slot.

getDefaultDataSourceType

Added in 1.0.0
Deprecated in 1.1.0
public final @NonNull ComplicationType getDefaultDataSourceType()

The default ComplicationType for this complication.

getFixedComplicationDataSource

Added in 1.0.0
public final boolean getFixedComplicationDataSource()

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

getNameResourceId

Added in 1.1.0
public final Integer getNameResourceId()

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.

getScreenReaderNameResourceId

Added in 1.1.0
public final Integer getScreenReaderNameResourceId()

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.

getSupportedTypes

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

The ComplicationTypes supported by this complication.

hashCode

public int hashCode()

isEnabled

Added in 1.0.0
public final boolean isEnabled()

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

isInitiallyEnabled

Added in 1.0.0
public final boolean isInitiallyEnabled()

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

toString

public @NonNull String toString()