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.foundation.Text

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

Companion properties

LineThrough

@Stable val LineThrough: TextDecoration

Draws a horizontal line over the text.

import androidx.ui.foundation.Text

Text(
    text = "Demo Text",
    textDecoration = TextDecoration.LineThrough
)

None

@Stable val None: TextDecoration

Underline

@Stable val Underline: TextDecoration

Draws a horizontal line below the text.

import androidx.ui.foundation.Text

Text(
    text = "Demo Text",
    textDecoration = TextDecoration.Underline
)