StyledText

Defined in package com.scandit.datacapture.core

StyledText
class StyledText

Added in version 8.6.0

Cross-platform rich (attributed) text. Each platform maps it to its own rich-text primitive: Android android.text.SpannableString, iOS Foundation.NSAttributedString.

StyledText()
StyledText(text: String,
        spans: List<StyledTextSpan>)

Added in version 8.6.0

Constructs styled text from plain text and its styling spans.

text
val text: String

Added in version 8.6.0

The plain text content.

spans
val spans: List<StyledTextSpan>

Added in version 8.6.0

The styling runs applied over ranges of text. Empty by default.

StyledTextSpan
class StyledTextSpan

Added in version 8.6.0

A single styling run applied to the half-open character range [start, end) of a StyledText.text.

StyledTextSpan()
StyledTextSpan(start: Int,
        end: Int,
        bold: Boolean,
        italic: Boolean,
        underline: Boolean,
        foregroundColor: Color?)

Added in version 8.6.0

Constructs a styling run over [start, end).

start
val start: Int

Added in version 8.6.0

The inclusive start index of the styled range.

end
val end: Int

Added in version 8.6.0

The exclusive end index of the styled range.

bold
val bold: Boolean

Added in version 8.6.0

Whether the range is rendered in a bold weight.

italic
val italic: Boolean

Added in version 8.6.0

Whether the range is rendered italic.

underline
val underline: Boolean

Added in version 8.6.0

Whether the range is underlined.

foregroundColor
val foregroundColor: Color?

Added in version 8.6.0

The text color of the range, or null to leave it unchanged.