Google is committed to advancing racial equity for Black communities. See how.

Builder

class Builder : BaseBuilder<TextViewStyle!, TextViewStyle.Builder!>
androidx.autofill.inline.common.TextViewStyle.Builder

Builder for the TextViewStyle.

Summary

Public constructors

Public methods
TextViewStyle

TextViewStyle.Builder
setTextColor(@ColorInt textColor: Int)

Specifies the text color.

TextViewStyle.Builder
setTextSize(textSize: Float)

Specifies the text size, in sp.

TextViewStyle.Builder
setTextSize(unit: Int, size: Float)

Specifies the text size in the provided unit.

TextViewStyle.Builder
setTypeface(@NonNull fontFamily: String, fontStyle: Int)

Specifies the text font family and style.

Public constructors

<init>

Builder()

Public methods

build

@NonNull fun build(): TextViewStyle

setTextColor

@NonNull fun setTextColor(@ColorInt textColor: Int): TextViewStyle.Builder

Specifies the text color.

Parameters
textColor Int: A color value in the form 0xAARRGGBB.

setTextSize

@NonNull fun setTextSize(textSize: Float): TextViewStyle.Builder

Specifies the text size, in sp.

Parameters
textSize Float: The scaled pixel size.

setTextSize

@NonNull fun setTextSize(
    unit: Int,
    size: Float
): TextViewStyle.Builder

Specifies the text size in the provided unit.

Parameters
unit Int: The desired dimension unit.
size Float: The device independent pixel size.

setTypeface

@NonNull fun setTypeface(
    @NonNull fontFamily: String,
    fontStyle: Int
): TextViewStyle.Builder

Specifies the text font family and style. If the font family can not be found/loaded from the renderer process, it may fallback to the default system font.

Parameters
fontFamily String: the font family for the type face
fontStyle Int: the style for the type face.