class ComplicationStyle


Defines attributes to customize appearance of rendered [ ].

Summary

Constants

const @Px Int

Default border radius.

const Int

Style where the borders are drawn as dashed lines.

const Int

Style where the borders are not drawn.

const Int

Style where the borders are drawn without any gap.

Public constructors

Public functions

Unit
setTextTypeface(textTypeface: Typeface)

Sets Typeface to use when rendering short text and long text fields.

Unit
setTitleTypeface(titleTypeface: Typeface)

Sets the Typeface to render the title for short and long text with.

Public properties

@ColorInt Int

The background color to be used.

Drawable?

The background drawable to be used, or null if there's no background drawable.

Int

The color to render the complication border with.

Int

The dash gap to be used when drawing borders of type .BORDER_STYLE_DASHED.

Int

The dash width to be used when drawing borders of type .BORDER_STYLE_DASHED.

Int

The border radius to be applied to the corners of the bounds of the complication in active mode.

Int

The style to render the complication border with.

Int

The width to render the complication border with.

Int

The highlight color to be used when the complication is highlighted.

Int

The color for tinting icons.

ColorFilter?

The color filter used in active mode when rendering large images and small images with style SmallImageType.PHOTO.

Int

The color to be used when rendering first part of ranged value indicator.

Int

The ring width to be used when rendering ranged value indicator.

Int

The color to be used when rendering second part of ranged value indicator.

@ColorInt Int

The color to render the text with.

Int

Returns the text size to be used for short and long text fields.

Typeface

The typeface to be used for short and long text.

@ColorInt Int

The color to render the title with.

Int

The text size to be used for short and long title fields.

Typeface

The typeface to be used for short and long title.

Constants

BORDER_RADIUS_DEFAULT

const val BORDER_RADIUS_DEFAULT: @Px Int

Default border radius.

BORDER_STYLE_DASHED

const val BORDER_STYLE_DASHED = 2: Int

Style where the borders are drawn as dashed lines. If this is set as current border style, dash width and dash gap should also be set via .setBorderDashWidth, .setBorderDashGap or XML attributes, or default values will be used.

BORDER_STYLE_NONE

const val BORDER_STYLE_NONE = 0: Int

Style where the borders are not drawn.

BORDER_STYLE_SOLID

const val BORDER_STYLE_SOLID = 1: Int

Style where the borders are drawn without any gap.

Public constructors

ComplicationStyle

Added in 1.0.0
ComplicationStyle()

ComplicationStyle

Added in 1.0.0
ComplicationStyle(style: ComplicationStyle)

Public functions

setTextTypeface

Added in 1.0.0
fun setTextTypeface(textTypeface: Typeface): Unit

Sets Typeface to use when rendering short text and long text fields.

Parameters
textTypeface: Typeface

The Typeface to render the text with

setTitleTypeface

Added in 1.0.0
fun setTitleTypeface(titleTypeface: Typeface): Unit

Sets the Typeface to render the title for short and long text with.

Parameters
titleTypeface: Typeface

The Typeface to render the title with

Public properties

backgroundColor

Added in 1.0.0
var backgroundColor: @ColorInt Int

The background color to be used.

backgroundDrawable

Added in 1.0.0
var backgroundDrawableDrawable?

The background drawable to be used, or null if there's no background drawable.

borderColor

Added in 1.0.0
var borderColorInt

The color to render the complication border with.

borderDashGap

Added in 1.0.0
var borderDashGapInt

The dash gap to be used when drawing borders of type .BORDER_STYLE_DASHED.

borderDashWidth

Added in 1.0.0
var borderDashWidthInt

The dash width to be used when drawing borders of type .BORDER_STYLE_DASHED.

borderRadius

Added in 1.0.0
var borderRadiusInt

The border radius to be applied to the corners of the bounds of the complication in active mode. Border radius will be limited to the half of width or height, depending on which one is smaller. If ComplicationStyle.BORDER_RADIUS_DEFAULT is returned, border radius should be reduced to half of the minimum of width or height during the rendering.

borderStyle

Added in 1.0.0
var borderStyleInt

The style to render the complication border with.

borderWidth

Added in 1.0.0
var borderWidthInt

The width to render the complication border with.

highlightColor

Added in 1.0.0
var highlightColorInt

The highlight color to be used when the complication is highlighted.

iconColor

Added in 1.0.0
var iconColorInt

The color for tinting icons.

imageColorFilter

Added in 1.0.0
var imageColorFilterColorFilter?

The color filter used in active mode when rendering large images and small images with style SmallImageType.PHOTO.

rangedValuePrimaryColor

Added in 1.0.0
var rangedValuePrimaryColorInt

The color to be used when rendering first part of ranged value indicator.

rangedValueRingWidth

Added in 1.0.0
var rangedValueRingWidthInt

The ring width to be used when rendering ranged value indicator.

rangedValueSecondaryColor

Added in 1.0.0
var rangedValueSecondaryColorInt

The color to be used when rendering second part of ranged value indicator.

textColor

Added in 1.0.0
var textColor: @ColorInt Int

The color to render the text with. Text color is used for rendering short text and long text fields.

textSize

Added in 1.0.0
var textSizeInt

Returns the text size to be used for short and long text fields.

textTypeface

Added in 1.0.0
val textTypefaceTypeface

The typeface to be used for short and long text.

titleColor

Added in 1.0.0
var titleColor: @ColorInt Int

The color to render the title with. Title color is used for rendering short title and long title fields.

titleSize

Added in 1.0.0
var titleSizeInt

The text size to be used for short and long title fields.

titleTypeface

Added in 1.0.0
val titleTypefaceTypeface

The typeface to be used for short and long title.