addLink

open override fun addLink(url: OudsLinkAnnotation.Url, start: Int, end: Int)

Set a OudsLinkAnnotation.Url for the given range defined by start and end.

When clicking on the text in range, the corresponding URL from the url annotation will be opened using androidx.compose.ui.platform.UriHandler.

URLs may be treated specially by screen readers, including being identified while reading text with an audio icon or being summarized in a links menu.

Parameters

url

A OudsLinkAnnotation.Url object that stores the URL being linked to.

start

The inclusive starting offset of the range.

end

The exclusive end offset of the range.


open override fun addLink(clickable: OudsLinkAnnotation.Clickable, start: Int, end: Int)

Set a OudsLinkAnnotation.Clickable for the given range defined by start and end.

When clicking on the text in range, a LinkInteractionListener will be triggered with the clickable object.

Clickable link may be treated specially by screen readers, including being identified while reading text with an audio icon or being summarized in a links menu.

Parameters

clickable

A LinkAnnotation.Clickable object that stores the tag being linked to.

start

The inclusive starting offset of the range.

end

The exclusive end offset of the range.