ComplicationStyle

public final class ComplicationStyle


Defines attributes to customize appearance of rendered [ ].

Summary

Public fields

final @ColorInt int

The background color to be used.

final @Nullable Drawable

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

final int

The color to render the complication border with.

final int

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

final int

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

final 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 int

The width to render the complication border with.

final int

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

final int

The color for tinting icons.

final @Nullable ColorFilter

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

final int

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

final int

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

final 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 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 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.

Public methods

final void

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

final void

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

Public fields

backgroundColor

@ColorInt
@NonNull
public final @ColorInt int backgroundColor

The background color to be used.

backgroundDrawable

@Nullable
public final @Nullable Drawable backgroundDrawable

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

borderColor

@NonNull
public final int borderColor

The color to render the complication border with.

borderDashGap

@NonNull
public final int borderDashGap

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

borderDashWidth

@NonNull
public final int borderDashWidth

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

borderRadius

@NonNull
public final 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.

borderStyle

@NonNull
public final int borderStyle

The style to render the complication border with.

borderWidth

@NonNull
public final int borderWidth

The width to render the complication border with.

highlightColor

@NonNull
public final int highlightColor

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

iconColor

@NonNull
public final int iconColor

The color for tinting icons.

imageColorFilter

@Nullable
public final @Nullable ColorFilter imageColorFilter

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

rangedValuePrimaryColor

@NonNull
public final int rangedValuePrimaryColor

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

rangedValueRingWidth

@NonNull
public final int rangedValueRingWidth

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

rangedValueSecondaryColor

@NonNull
public final int rangedValueSecondaryColor

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

textColor

@ColorInt
@NonNull
public final @ColorInt int textColor

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

textSize

@NonNull
public final int textSize

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

textTypeface

@NonNull
public final @NonNull Typeface textTypeface

The typeface to be used for short and long text.

titleColor

@ColorInt
@NonNull
public final @ColorInt int titleColor

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

titleSize

@NonNull
public final int titleSize

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

titleTypeface

@NonNull
public final @NonNull Typeface titleTypeface

The typeface to be used for short and long title.

Public constructors

ComplicationStyle

public final ComplicationStyle()

ComplicationStyle

public final ComplicationStyle(@NonNull ComplicationStyle style)

Public methods

setTextTypeface

@NonNull
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

setTitleTypeface

@NonNull
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