TextDecoration
-
Cmn
class TextDecoration
Defines a horizontal line to be drawn on the text.
Summary
Public companion functions |
||
|---|---|---|
TextDecoration |
combine(decorations: List<TextDecoration>)Creates a decoration that includes all the given decorations. |
Cmn
|
TextDecoration |
Construct a TextDecoration instance from the underlying |
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)Check whether this |
Cmn
|
open operator Boolean |
Cmn
|
|
open Int |
hashCode() |
Cmn
|
operator TextDecoration |
plus(decoration: TextDecoration)Creates a decoration that includes both of the TextDecorations. |
Cmn
|
open String |
toString() |
Cmn
|
Public companion functions
combine
fun combine(decorations: List<TextDecoration>): TextDecoration
Creates a decoration that includes all the given decorations.
import androidx.compose.material.Text import androidx.compose.ui.text.style.TextDecoration Text(text = "Demo Text", textDecoration = TextDecoration.Underline + TextDecoration.LineThrough)
| Parameters | |
|---|---|
decorations: List<TextDecoration> |
The decorations to be added |
valueOf
fun valueOf(mask: Int): TextDecoration
Construct a TextDecoration instance from the underlying TextDecoration.mask. This method will attempt to avoid allocations in cases of well known decorations, but is not guaranteed to not allocate.
| Parameters | |
|---|---|
mask: Int |
The integer representation of the TextDecoration. |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if the |
| See also | |
|---|---|
mask |
Public companion properties
LineThrough
val LineThrough: TextDecoration
Draws a horizontal line over the text.
import androidx.compose.material.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.material.Text import androidx.compose.ui.text.style.TextDecoration Text(text = "Demo Text", textDecoration = TextDecoration.Underline)
Public functions
contains
operator fun contains(other: TextDecoration): Boolean
Check whether this TextDecoration contains the given decoration.
| Parameters | |
|---|---|
other: TextDecoration |
The |
plus
operator fun plus(decoration: TextDecoration): TextDecoration
Creates a decoration that includes both of the TextDecorations.
import androidx.compose.material.Text import androidx.compose.ui.text.style.TextDecoration Text(text = "Demo Text", textDecoration = TextDecoration.Underline + TextDecoration.LineThrough)