TextDecoration

@Immutable data class TextDecoration
kotlin.Any
   ↳ androidx.ui.text.style.TextDecoration

Defines a horizontal line to be drawn on the text.

Summary

Public methods

Boolean

Check whether this TextDecoration contains the given decoration.

String

Companion functions

TextDecoration
combine(decorations: List<TextDecoration>)

Creates a decoration that includes all the given decorations.

Properties

Int

Companion properties

TextDecoration

Draws a horizontal line over the text.

TextDecoration

TextDecoration

Draws a horizontal line below the text.

Public methods

contains

fun contains(other: TextDecoration): Boolean

Check whether this TextDecoration contains the given decoration.

Parameters
other: TextDecoration The TextDecoration to be checked.

toString

fun toString(): String

Properties

mask

val mask: Int

Companion functions

combine

fun combine(decorations: List<TextDecoration>): TextDecoration

Creates a decoration that includes all the given decorations.

import androidx.ui.core.Text
import androidx.ui.text.TextStyle

Text(
    text = "Demo Text",
    style = TextStyle(
        decoration = TextDecoration.combine(
            listOf(
                TextDecoration.Underline,
                TextDecoration.LineThrough
            )
        )
    )
)
Parameters
decorations: List<TextDecoration> The decorations to be added

Companion properties

LineThrough

val LineThrough: TextDecoration

Draws a horizontal line over the text.

import androidx.ui.core.Text
import androidx.ui.text.TextStyle

Text(
    text = "Demo Text",
    style = TextStyle(decoration = TextDecoration.LineThrough)
)

None

val None: TextDecoration

Underline

val Underline: TextDecoration

Draws a horizontal line below the text.

import androidx.ui.core.Text
import androidx.ui.text.TextStyle

Text(
    text = "Demo Text",
    style = TextStyle(decoration = TextDecoration.Underline)
)