TextDecoration


Defines text decorations such as underline or line-through.

Summary

Public companion functions

TextDecoration
combine(decorations: List<TextDecoration>)

Combines multiple TextDecorations into a single decoration.

Cmn
TextDecoration
valueOf(mask: Int)

Creates a TextDecoration from a mask.

Cmn

Public companion properties

TextDecoration

Draws a horizontal line over the text.

Cmn
TextDecoration
Cmn
TextDecoration

Draws a horizontal line below the text.

Cmn

Public functions

operator Boolean

Checks if this decoration contains other.

Cmn
open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
operator TextDecoration
plus(decoration: TextDecoration)

Combines this decoration with decoration.

Cmn
open String
Cmn

Public properties

Int

bitmask representing the combined decorations.

Cmn

Public companion functions

combine

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

Combines multiple TextDecorations into a single decoration.

import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

Text(text = "Demo Text", textDecoration = TextDecoration.Underline + TextDecoration.LineThrough)
Parameters
decorations: List<TextDecoration>

decorations to combine.

valueOf

fun valueOf(mask: Int): TextDecoration

Creates a TextDecoration from a mask.

Attempts to avoid allocations for well-known decorations.

Parameters
mask: Int

bitmask of the decoration.

Throws
IllegalArgumentException

if mask is invalid.

See also
mask

Public companion properties

LineThrough

val LineThroughTextDecoration

Draws a horizontal line over the text.

import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

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

None

val NoneTextDecoration

Underline

val UnderlineTextDecoration

Draws a horizontal line below the text.

import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

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

Public functions

contains

operator fun contains(other: TextDecoration): Boolean

Checks if this decoration contains other.

Parameters
other: TextDecoration

decoration to check.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

plus

operator fun plus(decoration: TextDecoration): TextDecoration

Combines this decoration with decoration.

import androidx.compose.material3.Text
import androidx.compose.ui.text.style.TextDecoration

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

toString

open fun toString(): String

Public properties

mask

val maskInt

bitmask representing the combined decorations.