textComponent

fun textComponent(color: Color = Color.Black, textSize: TextUnit = DefaultDimens.TEXT_COMPONENT_TEXT_SIZE.sp, background: ShapeComponent? = null, ellipsize: TextUtils.TruncateAt = TextUtils.TruncateAt.END, lineCount: Int = DEF_LABEL_LINE_COUNT, padding: MutableDimensions = emptyDimensions(), margins: MutableDimensions = emptyDimensions(), typeface: Typeface? = null, textAlignment: Layout.Alignment = Layout.Alignment.ALIGN_NORMAL): TextComponent

Creates a TextComponent.

Parameters

color

the text color.

textSize

the text size.

background

an optional ShapeComponent to be displayed behind the text.

ellipsize

the text truncation behavior.

lineCount

the line count.

padding

the padding between the text and the background.

margins

the margins around the background.

typeface

the Typeface for the text.

textAlignment

the text alignment.


fun textComponent(color: Color = Color.Black, textSize: TextUnit = DefaultDimens.TEXT_COMPONENT_TEXT_SIZE.sp, background: ShapeComponent? = null, ellipsize: TextUtils.TruncateAt = TextUtils.TruncateAt.END, lineCount: Int = DEF_LABEL_LINE_COUNT, padding: MutableDimensions = emptyDimensions(), margins: MutableDimensions = emptyDimensions(), typeface: Typeface? = null, textAlign: Paint.Align): TextComponent

Deprecated

Instead of `textAlign`, use `textAlignment`.

Creates a TextComponent.

Parameters

color

the text color.

textSize

the text size.

background

an optional ShapeComponent to be displayed behind the text.

ellipsize

the text truncation behavior.

lineCount

the line count.

padding

the padding between the text and the background.

margins

the margins around the background.

typeface

the Typeface for the text.

textAlign

the text alignment.