TextDecoration
-
Cmn
class TextDecoration
Defines text decorations such as underline or line-through.
Summary
Public companion functions |
||
|---|---|---|
TextDecoration |
combine(decorations: List<TextDecoration>)Combines multiple |
Cmn
|
TextDecoration |
Creates a |
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 |
contains(other: TextDecoration)Checks if this decoration contains |
Cmn
|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
operator TextDecoration |
plus(decoration: TextDecoration)Combines this decoration with |
Cmn
|
open String |
toString() |
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 |
| See also | |
|---|---|
mask |
Public companion properties
LineThrough
val LineThrough: TextDecoration
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)
Underline
val Underline: TextDecoration
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. |
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)