ComplicationSlot.Companion
object ComplicationSlot.Companion
Summary
Public methods
createBackgroundComplicationSlotBuilder
public final @NonNull ComplicationSlot.Builder createBackgroundComplicationSlotBuilder(
int id,
CanvasComplicationFactory canvasComplicationFactory,
List<ComplicationType> supportedTypes,
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy
)
Constructs a Builder
for a complication with bound type ComplicationSlotBoundsType.BACKGROUND
whose bounds cover the entire screen. A background complication is for watch faces that wish to have a full screen user selectable backdrop. This sort of complication isn't clickable and at most one may be present in the list of complicationSlots.
Parameters | |
---|---|
int id |
The watch face's ID for this complication. Can be any integer but should be unique within the watch face. |
CanvasComplicationFactory canvasComplicationFactory |
The |
List<ComplicationType> supportedTypes |
The types of complication supported by this ComplicationSlot. Used during complication, this list should be non-empty. |
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy |
The |
createEdgeComplicationSlotBuilder
public final @NonNull ComplicationSlot.Builder createEdgeComplicationSlotBuilder(
int id,
CanvasComplicationFactory canvasComplicationFactory,
List<ComplicationType> supportedTypes,
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
ComplicationSlotBounds bounds,
ComplicationTapFilter complicationTapFilter
)
Constructs a Builder
for a complication with bounds type ComplicationSlotBoundsType.EDGE
.
An edge complication is drawn around the border of the display and has custom hit test logic (see complicationTapFilter
). When tapped the associated intent is dispatched. Edge complicationSlots should have a custom renderer
with CanvasComplication.drawHighlight
overridden.
Note hit detection in an editor for ComplicationSlot
s created with this method is not supported.
Parameters | |
---|---|
int id |
The watch face's ID for this complication. Can be any integer but should be unique within the watch face. |
CanvasComplicationFactory canvasComplicationFactory |
The |
List<ComplicationType> supportedTypes |
The types of complication supported by this ComplicationSlot. Used during complication, this list should be non-empty. |
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy |
The |
ComplicationSlotBounds bounds |
The complication's |
ComplicationTapFilter complicationTapFilter |
The |
createEdgeComplicationSlotBuilder
@ComplicationExperimental
public final @NonNull ComplicationSlot.Builder createEdgeComplicationSlotBuilder(
int id,
CanvasComplicationFactory canvasComplicationFactory,
List<ComplicationType> supportedTypes,
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
ComplicationSlotBounds bounds,
BoundingArc boundingArc,
ComplicationTapFilter complicationTapFilter
)
Constructs a Builder
for a complication with bounds type ComplicationSlotBoundsType.EDGE
, whose contents are contained within boundingArc
.
Parameters | |
---|---|
int id |
The watch face's ID for this complication. Can be any integer but should be unique within the watch face. |
CanvasComplicationFactory canvasComplicationFactory |
The |
List<ComplicationType> supportedTypes |
The types of complication supported by this ComplicationSlot. Used during complication, this list should be non-empty. |
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy |
The |
ComplicationSlotBounds bounds |
The complication's |
createRoundRectComplicationSlotBuilder
public final @NonNull ComplicationSlot.Builder createRoundRectComplicationSlotBuilder(
int id,
CanvasComplicationFactory canvasComplicationFactory,
List<ComplicationType> supportedTypes,
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy,
ComplicationSlotBounds bounds
)
Constructs a Builder
for a complication with bounds type ComplicationSlotBoundsType.ROUND_RECT
. This is the most common type of complication. These can be tapped by the user to trigger the associated intent.
Parameters | |
---|---|
int id |
The watch face's ID for this complication. Can be any integer but should be unique within the watch face. |
CanvasComplicationFactory canvasComplicationFactory |
The |
List<ComplicationType> supportedTypes |
The types of complication supported by this ComplicationSlot. Used during complication, this list should be non-empty. |
DefaultComplicationDataSourcePolicy defaultDataSourcePolicy |
The |
ComplicationSlotBounds bounds |
The complication's |