public final class ComplicationStyle


Defines attributes to customize appearance of rendered [ ].

Summary

Constants

static final @Px int

Default border radius.

static final int

Style where the borders are drawn as dashed lines.

static final int

Style where the borders are not drawn.

static final int

Style where the borders are drawn without any gap.

Public methods

final @ColorInt int

The background color to be used.

final Drawable

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

final @ColorInt int

The color to render the complication border with.

final @Px int

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

final @Px int

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

final @Px int

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

final int

The style to render the complication border with.

final @Px int

The width to render the complication border with.

final @ColorInt int

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

final @ColorInt int

The color for tinting icons.

final ColorFilter

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

final @ColorInt int

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

final @Px int

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

final @ColorInt int

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

final @ColorInt int

The color to render the text with.

final @Px int

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

final @NonNull Typeface

The typeface to be used for short and long text.

final @ColorInt int

The color to render the title with.

final @Px int

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

final @NonNull Typeface

The typeface to be used for short and long title.

final void
setBackgroundColor(@ColorInt int backgroundColor)

The background color to be used.

final void
setBackgroundDrawable(Drawable backgroundDrawable)

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

final void
setBorderColor(int borderColor)

The color to render the complication border with.

final void
setBorderDashGap(int borderDashGap)

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

final void
setBorderDashWidth(int borderDashWidth)

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

final void
setBorderRadius(int borderRadius)

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

final void
setBorderStyle(int borderStyle)

The style to render the complication border with.

final void
setBorderWidth(int borderWidth)

The width to render the complication border with.

final void
setHighlightColor(int highlightColor)

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

final void
setIconColor(int iconColor)

The color for tinting icons.

final void
setImageColorFilter(ColorFilter imageColorFilter)

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

final void
setRangedValuePrimaryColor(int rangedValuePrimaryColor)

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

final void
setRangedValueRingWidth(int rangedValueRingWidth)

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

final void
setRangedValueSecondaryColor(int rangedValueSecondaryColor)

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

final void
setTextColor(@ColorInt int textColor)

The color to render the text with.

final void
setTextSize(int textSize)

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

final void

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

final void
setTitleColor(@ColorInt int titleColor)

The color to render the title with.

final void
setTitleSize(int titleSize)

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

final void

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

Constants

BORDER_RADIUS_DEFAULT

public static final @Px int BORDER_RADIUS_DEFAULT

Default border radius.

BORDER_STYLE_DASHED

public static final int BORDER_STYLE_DASHED = 2

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

public static final int BORDER_STYLE_NONE = 0

Style where the borders are not drawn.

BORDER_STYLE_SOLID

public static final int BORDER_STYLE_SOLID = 1

Style where the borders are drawn without any gap.

Public constructors

ComplicationStyle

Added in 1.0.0
public ComplicationStyle()

ComplicationStyle

Added in 1.0.0
public ComplicationStyle(@NonNull ComplicationStyle style)

Public methods

getBackgroundColor

Added in 1.0.0
public final @ColorInt int getBackgroundColor()

The background color to be used.

getBackgroundDrawable

Added in 1.0.0
public final Drawable getBackgroundDrawable()

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

getBorderColor

Added in 1.0.0
public final @ColorInt int getBorderColor()

The color to render the complication border with.

getBorderDashGap

Added in 1.0.0
public final @Px int getBorderDashGap()

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

getBorderDashWidth

Added in 1.0.0
public final @Px int getBorderDashWidth()

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

getBorderRadius

Added in 1.0.0
public final @Px int getBorderRadius()

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.

getBorderStyle

Added in 1.0.0
public final int getBorderStyle()

The style to render the complication border with.

getBorderWidth

Added in 1.0.0
public final @Px int getBorderWidth()

The width to render the complication border with.

getHighlightColor

Added in 1.0.0
public final @ColorInt int getHighlightColor()

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

getIconColor

Added in 1.0.0
public final @ColorInt int getIconColor()

The color for tinting icons.

getImageColorFilter

Added in 1.0.0
public final ColorFilter getImageColorFilter()

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

getRangedValuePrimaryColor

Added in 1.0.0
public final @ColorInt int getRangedValuePrimaryColor()

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

getRangedValueRingWidth

Added in 1.0.0
public final @Px int getRangedValueRingWidth()

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

getRangedValueSecondaryColor

Added in 1.0.0
public final @ColorInt int getRangedValueSecondaryColor()

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

getTextColor

Added in 1.0.0
public final @ColorInt int getTextColor()

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

getTextSize

Added in 1.0.0
public final @Px int getTextSize()

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

getTextTypeface

Added in 1.0.0
public final @NonNull Typeface getTextTypeface()

The typeface to be used for short and long text.

getTitleColor

Added in 1.0.0
public final @ColorInt int getTitleColor()

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

getTitleSize

Added in 1.0.0
public final @Px int getTitleSize()

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

getTitleTypeface

Added in 1.0.0
public final @NonNull Typeface getTitleTypeface()

The typeface to be used for short and long title.

setBackgroundColor

Added in 1.0.0
public final void setBackgroundColor(@ColorInt int backgroundColor)

The background color to be used.

setBackgroundDrawable

Added in 1.0.0
public final void setBackgroundDrawable(Drawable backgroundDrawable)

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

setBorderColor

Added in 1.0.0
public final void setBorderColor(int borderColor)

The color to render the complication border with.

setBorderDashGap

Added in 1.0.0
public final void setBorderDashGap(int borderDashGap)

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

setBorderDashWidth

Added in 1.0.0
public final void setBorderDashWidth(int borderDashWidth)

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

setBorderRadius

Added in 1.0.0
public final void setBorderRadius(int borderRadius)

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.

setBorderStyle

Added in 1.0.0
public final void setBorderStyle(int borderStyle)

The style to render the complication border with.

setBorderWidth

Added in 1.0.0
public final void setBorderWidth(int borderWidth)

The width to render the complication border with.

setHighlightColor

Added in 1.0.0
public final void setHighlightColor(int highlightColor)

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

setIconColor

Added in 1.0.0
public final void setIconColor(int iconColor)

The color for tinting icons.

setImageColorFilter

Added in 1.0.0
public final void setImageColorFilter(ColorFilter imageColorFilter)

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

setRangedValuePrimaryColor

Added in 1.0.0
public final void setRangedValuePrimaryColor(int rangedValuePrimaryColor)

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

setRangedValueRingWidth

Added in 1.0.0
public final void setRangedValueRingWidth(int rangedValueRingWidth)

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

setRangedValueSecondaryColor

Added in 1.0.0
public final void setRangedValueSecondaryColor(int rangedValueSecondaryColor)

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

setTextColor

Added in 1.0.0
public final void setTextColor(@ColorInt int textColor)

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

setTextSize

Added in 1.0.0
public final void setTextSize(int textSize)

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

setTextTypeface

Added in 1.0.0
public final void setTextTypeface(@NonNull Typeface textTypeface)

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

Parameters
@NonNull Typeface textTypeface

The Typeface to render the text with

setTitleColor

Added in 1.0.0
public final void setTitleColor(@ColorInt int titleColor)

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

setTitleSize

Added in 1.0.0
public final void setTitleSize(int titleSize)

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

setTitleTypeface

Added in 1.0.0
public final void setTitleTypeface(@NonNull Typeface titleTypeface)

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

Parameters
@NonNull Typeface titleTypeface

The Typeface to render the title with