LayoutElementBuilders.FontStyle.Builder

public static final class LayoutElementBuilders.FontStyle.Builder
extends Object

java.lang.Object
   ↳ androidx.wear.tiles.builders.LayoutElementBuilders.FontStyle.Builder


Builder for LayoutElementBuilders.FontStyle

Summary

Public methods

LayoutElementBuilders.FontStyle build()

Builds an instance from accumulated values.

LayoutElementBuilders.FontStyle.Builder setColor(ColorBuilders.ColorProp color)

Sets the text color.

LayoutElementBuilders.FontStyle.Builder setColor(ColorBuilders.ColorProp.Builder colorBuilder)

Sets the text color.

LayoutElementBuilders.FontStyle.Builder setItalic(boolean italic)

Sets whether the text should be rendered in a italic typeface.

LayoutElementBuilders.FontStyle.Builder setLetterSpacing(DimensionBuilders.EmProp letterSpacing)

Sets the text letter-spacing.

LayoutElementBuilders.FontStyle.Builder setLetterSpacing(DimensionBuilders.EmProp.Builder letterSpacingBuilder)

Sets the text letter-spacing.

LayoutElementBuilders.FontStyle.Builder setSize(DimensionBuilders.SpProp.Builder sizeBuilder)

Sets the size of the font, in scaled pixels (sp).

LayoutElementBuilders.FontStyle.Builder setSize(DimensionBuilders.SpProp size)

Sets the size of the font, in scaled pixels (sp).

LayoutElementBuilders.FontStyle.Builder setUnderline(boolean underline)

Sets whether the text should be rendered with an underline.

LayoutElementBuilders.FontStyle.Builder setVariant(int variant)

Sets the variant of a font.

LayoutElementBuilders.FontStyle.Builder setWeight(int weight)

Sets the weight of the font.

Inherited methods

Public methods

build

public LayoutElementBuilders.FontStyle build ()

Builds an instance from accumulated values.

Returns
LayoutElementBuilders.FontStyle

setColor

public LayoutElementBuilders.FontStyle.Builder setColor (ColorBuilders.ColorProp color)

Sets the text color. If not defined, defaults to white.

Parameters
color ColorBuilders.ColorProp

Returns
LayoutElementBuilders.FontStyle.Builder

setColor

public LayoutElementBuilders.FontStyle.Builder setColor (ColorBuilders.ColorProp.Builder colorBuilder)

Sets the text color. If not defined, defaults to white.

Parameters
colorBuilder ColorBuilders.ColorProp.Builder

Returns
LayoutElementBuilders.FontStyle.Builder

setItalic

public LayoutElementBuilders.FontStyle.Builder setItalic (boolean italic)

Sets whether the text should be rendered in a italic typeface. If not specified, defaults to "false".

Parameters
italic boolean

Returns
LayoutElementBuilders.FontStyle.Builder

setLetterSpacing

public LayoutElementBuilders.FontStyle.Builder setLetterSpacing (DimensionBuilders.EmProp letterSpacing)

Sets the text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0.

Parameters
letterSpacing DimensionBuilders.EmProp

Returns
LayoutElementBuilders.FontStyle.Builder

setLetterSpacing

public LayoutElementBuilders.FontStyle.Builder setLetterSpacing (DimensionBuilders.EmProp.Builder letterSpacingBuilder)

Sets the text letter-spacing. Positive numbers increase the space between letters while negative numbers tighten the space. If not specified, defaults to 0.

Parameters
letterSpacingBuilder DimensionBuilders.EmProp.Builder

Returns
LayoutElementBuilders.FontStyle.Builder

setSize

public LayoutElementBuilders.FontStyle.Builder setSize (DimensionBuilders.SpProp.Builder sizeBuilder)

Sets the size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font.

Parameters
sizeBuilder DimensionBuilders.SpProp.Builder

Returns
LayoutElementBuilders.FontStyle.Builder

setSize

public LayoutElementBuilders.FontStyle.Builder setSize (DimensionBuilders.SpProp size)

Sets the size of the font, in scaled pixels (sp). If not specified, defaults to the size of the system's "body" font.

Parameters
size DimensionBuilders.SpProp

Returns
LayoutElementBuilders.FontStyle.Builder

setUnderline

public LayoutElementBuilders.FontStyle.Builder setUnderline (boolean underline)

Sets whether the text should be rendered with an underline. If not specified, defaults to "false".

Parameters
underline boolean

Returns
LayoutElementBuilders.FontStyle.Builder

setVariant

public LayoutElementBuilders.FontStyle.Builder setVariant (int variant)

Sets the variant of a font. Some renderers may use different fonts for title and body text, which can be selected using this field. If not specified, defaults to "body".

Parameters
variant int

Returns
LayoutElementBuilders.FontStyle.Builder

setWeight

public LayoutElementBuilders.FontStyle.Builder setWeight (int weight)

Sets the weight of the font. If the provided value is not supported on a platform, the nearest supported value will be used. If not defined, or when set to an invalid value, defaults to "normal".

Parameters
weight int

Returns
LayoutElementBuilders.FontStyle.Builder