TextViewStyle.Builder


class TextViewStyle.Builder


Builder for the TextViewStyle.

Summary

Public constructors

Public functions

TextViewStyle

Returns a subclass of BundledStyle built by this builder.

TextViewStyle.Builder
setTextColor(textColor: @ColorInt 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(fontFamily: String, fontStyle: Int)

Specifies the text font family and style.

Public constructors

Builder

Added in 1.1.0
Builder()

Public functions

build

Added in 1.1.0
fun build(): TextViewStyle

Returns a subclass of BundledStyle built by this builder.

setTextColor

Added in 1.1.0
fun setTextColor(textColor: @ColorInt Int): TextViewStyle.Builder

Specifies the text color.

Parameters
textColor: @ColorInt Int

A color value in the form 0xAARRGGBB.

See also
setTextColor

setTextSize

Added in 1.1.0
fun setTextSize(textSize: Float): TextViewStyle.Builder

Specifies the text size, in sp.

Parameters
textSize: Float

The scaled pixel size.

See also
setTextSize

setTextSize

Added in 1.1.0
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.

See also
setTextSize

setTypeface

Added in 1.1.0
fun setTypeface(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.

See also
create
setTypeface