LinkAnnotation.Clickable



An annotation that contains a clickable marked with tag. When clicking on the text to which this annotation is attached, the app will trigger a linkInteractionListener listener.

Summary

Public constructors

Clickable(
    tag: String,
    style: SpanStyle?,
    focusedStyle: SpanStyle?,
    hoveredStyle: SpanStyle?,
    pressedStyle: SpanStyle?,
    linkInteractionListener: LinkInteractionListener?
)
Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn
open LinkAnnotation.Clickable
withDefaultsFrom(
    defaultStyle: SpanStyle?,
    defaultFocusedStyle: SpanStyle?,
    defaultHoveredStyle: SpanStyle?,
    defaultPressedStyle: SpanStyle?
)

Returns a new LinkAnnotation which styles are a combination of its original styles and the given default styles.

Cmn

Public properties

open SpanStyle?

Style configuration for this link applied on top of the style when the link is focused.

Cmn
open SpanStyle?

Style configuration for this link applied on top of the style when the link is hovered.

Cmn
open LinkInteractionListener?

Interaction listener triggered when user interacts with this link.

Cmn
open SpanStyle?

Style configuration for this link applied on top of the style when the link is pressed.

Cmn
open SpanStyle?

Style configuration for this link that is always applied

Cmn
String
Cmn

Public constructors

Clickable

Clickable(
    tag: String,
    style: SpanStyle? = null,
    focusedStyle: SpanStyle? = null,
    hoveredStyle: SpanStyle? = null,
    pressedStyle: SpanStyle? = null,
    linkInteractionListener: LinkInteractionListener?
)

Public functions

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

withDefaultsFrom

open fun withDefaultsFrom(
    defaultStyle: SpanStyle?,
    defaultFocusedStyle: SpanStyle?,
    defaultHoveredStyle: SpanStyle?,
    defaultPressedStyle: SpanStyle?
): LinkAnnotation.Clickable

Returns a new LinkAnnotation which styles are a combination of its original styles and the given default styles.

This link's style's null or inherit properties are replaced with the non-null properties of the corresponding default style. Another way to think of it is that the "missing" properties of the style are filled by the properties of the corresponding default style.

Public properties

focusedStyle

open val focusedStyleSpanStyle?

Style configuration for this link applied on top of the style when the link is focused.

The resulting style of the link is always a combination of all styles merged into one in the order style.merge(focusedStyle).merge(hoveredStyle).merge(pressedStyle)

hoveredStyle

open val hoveredStyleSpanStyle?

Style configuration for this link applied on top of the style when the link is hovered.

The resulting style of the link is always a combination of all styles merged into one in the order style.merge(focusedStyle).merge(hoveredStyle).merge(pressedStyle)

linkInteractionListener

open val linkInteractionListenerLinkInteractionListener?

Interaction listener triggered when user interacts with this link.

pressedStyle

open val pressedStyleSpanStyle?

Style configuration for this link applied on top of the style when the link is pressed.

The resulting style of the link is always a combination of all styles merged into one in the order style.merge(focusedStyle).merge(hoveredStyle).merge(pressedStyle)

style

open val styleSpanStyle?

Style configuration for this link that is always applied

tag

val tagString