LinkBuilder

Interface for builders that support clickable link annotations.

Implementations can add links either by specifying ranges with addLink, or by using the push/pop pattern with pushLink and pop. For most use cases, prefer using the withLink DSL helper.

Inheritors

Functions

Link copied to clipboard
abstract fun addLink(clickable: OudsLinkAnnotation.Clickable, start: Int, end: Int)

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

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

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

Link copied to clipboard
abstract fun pop()

Ends the style or annotation that was added via a push operation before.

abstract fun pop(index: Int)

Ends the styles or annotation up to and including the StrongBuilder.pushStrong or LinkBuilder.pushLink that returned the given index.

Link copied to clipboard
abstract fun pushLink(link: OudsLinkAnnotation): Int

Attach the given OudsLinkAnnotation to any appended text until a corresponding pop is called.

Link copied to clipboard

DSL helper for applying link formatting to a block of text.