Android 12 Developer Preview is here! Try it out, and give us your feedback!

ComplicationStyle

open class ComplicationStyle
kotlin.Any
   ↳ androidx.wear.watchface.complications.rendering.ComplicationStyle

Defines attributes to customize appearance of rendered .

Summary

Constants
static Int

Default border radius.

static Int

Style where the borders are drawn as dashed lines.

static Int

Style where the borders are not drawn.

static Int

Style where the borders are drawn without any gap.

Public constructors

<init>(@NonNull style: ComplicationStyle)

Public methods
open Int

Returns the background color to be used.

open Drawable?

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

open Int

Returns the border color.

open Int

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

open Int

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

open Int

Returns the border radius.

open Int

open Int

Returns the border width.

open Int

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

open Int

Returns the color for tinting icons.

open ColorFilter?

Returns the color filter to be used when rendering small and large images, or null if there's no color filter.

open Int

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

open Int

Returns the ring width to be used when rendering ranged value indicator.

open Int

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

open Int

Returns the text color.

open Int

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

open Typeface?

Returns the typeface to be used for short and long text.

open Int

Returns the title color.

open Int

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

open Typeface?

Returns the typeface to be used for short and long title.

open Unit
setBackgroundColor(@ColorInt backgroundColor: Int)

Sets the background color.

open Unit
setBackgroundDrawable(@Nullable backgroundDrawable: Drawable?)

Sets the Drawable to render in the background.

open Unit
setBorderColor(@ColorInt borderColor: Int)

Sets the color to render the complication border with.

open Unit
setBorderDashGap(@Px borderDashGap: Int)

Sets the dash gap render the complication border with when drawing borders with style BORDER_STYLE_DASHED.

open Unit
setBorderDashWidth(@Px borderDashWidth: Int)

Sets dash widths to render the complication border with when drawing borders with style BORDER_STYLE_DASHED.

open Unit
setBorderRadius(@Px borderRadius: Int)

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

open Unit
setBorderStyle(borderStyle: Int)

Sets the style to render the complication border with.

open Unit
setBorderWidth(@Px borderWidth: Int)

Sets the width to render the complication border with.

open Unit
setHighlightColor(@ColorInt highlightColor: Int)

Sets the background color to use when the complication is highlighted.

open Unit
setIconColor(@ColorInt iconColor: Int)

Sets the color for tinting the icon with.

open Unit
setImageColorFilter(@Nullable colorFilter: ColorFilter?)

Sets the color filter used in active mode when rendering large images and small images with style ComplicationData#IMAGE_STYLE_PHOTO.

open Unit
setRangedValuePrimaryColor(@ColorInt rangedValuePrimaryColor: Int)

Sets the main color to render the ranged value text with.

open Unit
setRangedValueRingWidth(@Px rangedValueRingWidth: Int)

Sets the stroke width used when rendering the ranged value indicator.

open Unit