LayoutElementBuilders.FontStyle.Builder

public final class LayoutElementBuilders.FontStyle.Builder


Builder for FontStyle

Summary

Public methods

@NonNull LayoutElementBuilders.FontStyle

Builds an instance from accumulated values.

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the text color.

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the text color.

@NonNull LayoutElementBuilders.FontStyle.Builder

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

@NonNull LayoutElementBuilders.FontStyle.Builder
setItalic(@NonNull boolean italic)

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

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the text letter-spacing.

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the text letter-spacing.

@NonNull LayoutElementBuilders.FontStyle.Builder

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

@NonNull LayoutElementBuilders.FontStyle.Builder

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

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets whether the text should be rendered with an underline.

@NonNull LayoutElementBuilders.FontStyle.Builder
setUnderline(@NonNull boolean underline)

Sets whether the text should be rendered with an underline.

@TilesExperimental @NonNull LayoutElementBuilders.FontStyle.Builder

Sets the variant of a font.

@TilesExperimental @NonNull LayoutElementBuilders.FontStyle.Builder

Sets the variant of a font.

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the weight of the font.

@NonNull LayoutElementBuilders.FontStyle.Builder

Sets the weight of the font.

Public methods

build

@NonNull
public LayoutElementBuilders.FontStyle build()

Builds an instance from accumulated values.

setColor

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

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

setColor

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

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

setItalic

@NonNull
public LayoutElementBuilders.FontStyle.Builder setItalic(@NonNull TypeBuilders.BoolProp italic)

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

setItalic

@NonNull
public LayoutElementBuilders.FontStyle.Builder setItalic(@NonNull boolean italic)

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

setLetterSpacing

@NonNull
public LayoutElementBuilders.FontStyle.Builder setLetterSpacing(@NonNull 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.

setLetterSpacing

@NonNull
public LayoutElementBuilders.FontStyle.Builder setLetterSpacing(
    @NonNull 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.

setSize

@NonNull
public LayoutElementBuilders.FontStyle.Builder setSize(@NonNull 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.

setSize

@NonNull
public LayoutElementBuilders.FontStyle.Builder setSize(@NonNull 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.

setUnderline

@NonNull
public LayoutElementBuilders.FontStyle.Builder setUnderline(@NonNull TypeBuilders.BoolProp underline)

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

setUnderline

@NonNull
public LayoutElementBuilders.FontStyle.Builder setUnderline(@NonNull boolean underline)

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

setVariant

@TilesExperimental
@NonNull
public @TilesExperimental LayoutElementBuilders.FontStyle.Builder setVariant(@NonNull LayoutElementBuilders.FontVariantProp 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".

setVariant

@TilesExperimental
@NonNull
public @TilesExperimental LayoutElementBuilders.FontStyle.Builder setVariant(@LayoutElementBuilders.FontVariant @NonNull 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".

setWeight

@NonNull
public LayoutElementBuilders.FontStyle.Builder setWeight(@NonNull LayoutElementBuilders.FontWeightProp 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".

setWeight

@NonNull
public LayoutElementBuilders.FontStyle.Builder setWeight(@LayoutElementBuilders.FontWeight @NonNull 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".