{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

TextDecoration

public final class TextDecoration


Defines a horizontal line to be drawn on the text.

Summary

Nested types

public static class TextDecoration.Companion

Public methods

final boolean

Check whether this TextDecoration contains the given decoration.

boolean
equals(Object other)
final int
int
final @NonNull TextDecoration

Creates a decoration that includes both of the TextDecorations.

@NonNull String

Public methods

contains

public final boolean contains(@NonNull TextDecoration other)

Check whether this TextDecoration contains the given decoration.

Parameters
@NonNull TextDecoration other

The TextDecoration to be checked.

equals

public boolean equals(Object other)

getMask

public final int getMask()

hashCode

public int hashCode()

plus

public final @NonNull TextDecoration plus(@NonNull TextDecoration decoration)

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
)

toString

public @NonNull String toString()