🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

LinkAnnotation

An annotation that represents a clickable part of the text.

Source set: Common
public abstract class LinkAnnotation private constructor() : AnnotatedString.Annotation

An annotation that represents a clickable part of the text.

Properties

linkInteractionListener

Source set: Common
public abstract val linkInteractionListener: LinkInteractionListener?

Interaction listener triggered when user interacts with this link.

styles

Source set: Common
public abstract val styles: TextLinkStyles?

Style configuration for this link in different states.

Members

Url

Source set: Common
public class Url(
        public val url: String,
        public override val styles: TextLinkStyles? = null,
        public override val linkInteractionListener: LinkInteractionListener? = null,
    ) : LinkAnnotation()

An annotation that contains a url string. When clicking on the text to which this annotation is attached, the app will try to open the url using androidx.compose.ui.platform.UriHandler. However, if linkInteractionListener is provided, its LinkInteractionListener.onClick method will be called instead and so you need to then handle opening url manually (for example by calling androidx.compose.ui.platform.UriHandler).

Functions

copy

Source set: Common
public fun copy(
            url: String = this.url,
            styles: TextLinkStyles? = this.styles,
            linkInteractionListener: LinkInteractionListener? = this.linkInteractionListener,
        ): Url

Returns a copy of this Url, optionally overriding some of the values.

Clickable

Source set: Common
public class Clickable(
        public val tag: String,
        public override val styles: TextLinkStyles? = null,
        // nullable for the save/restore purposes
        public override val linkInteractionListener: LinkInteractionListener?,
    ) : LinkAnnotation()

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.

Functions

copy

Source set: Common
public fun copy(
            tag: String = this.tag,
            styles: TextLinkStyles? = this.styles,
            linkInteractionListener: LinkInteractionListener? = this.linkInteractionListener,
        ): Clickable

Returns a copy of this Clickable, optionally overriding some of the values.