Builder

Builder for creating OudsAnnotatedBulletListLabel with strong text and link formatting.

Supports both strong text and link annotations through addStrong, pushStrong, addLink, and pushLink methods, or more conveniently through the withStrong and withLink DSL helpers.

Parameters

capacity

Initial capacity for the underlying string builder. Defaults to 16.

Constructors

Link copied to clipboard
constructor(capacity: Int = 16)
constructor(text: String)

Creates a builder initialized with plain text.

constructor(text: OudsAnnotatedHelperText)

Creates a builder initialized with an existing annotated helper text.

Functions

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

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

open override 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
open override fun addStrong(start: Int, end: Int)

Adds strong (bold/emphasized) formatting to a specific range of text.

Link copied to clipboard

Appends an annotated string to this builder, preserving its formatting.

fun append(text: String)

Appends the given String to this Builder.

Appends text to this Builder if non-null, and returns this Builder.

fun append(text: OudsAnnotatedBulletListLabel, start: Int, end: Int)

Appends a portion of an annotated string to this builder, preserving its formatting.

Appends the range of text between start (inclusive) and end (exclusive) to this Builder if non-null, and returns this Builder.

Link copied to clipboard
fun pop()

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

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
open override fun pushLink(link: OudsLinkAnnotation): Int

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

Link copied to clipboard
open override fun pushStrong(): Int

Applies strong (bold/emphasized) style to any appended text until a corresponding pop is called.

Link copied to clipboard

Constructs an OudsAnnotatedString based on the configurations applied to the Builder.

Link copied to clipboard

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

Link copied to clipboard

DSL helper for applying strong (bold/emphasized) formatting to a block of text.