androidx.core.text
Interfaces
TextDirectionHeuristicCompat |
Interface for objects that use a heuristic for guessing at the paragraph direction by examining text. |
Classes
BidiFormatter |
Utility class for formatting text for display in a potentially opposite-directionality context without garbling. |
HtmlCompat |
Backwards compatible version of |
ICUCompat | |
PrecomputedTextCompat |
A text which has the character metrics data. |
TextDirectionHeuristicsCompat |
Some objects that implement TextDirectionHeuristic. |
TextUtilsCompat |
Backwards compatible version of |
Top-level functions summary
SpannedString |
buildSpannedString(builderAction: SpannableStringBuilder.() -> Unit) Builds new string by populating a newly created SpannableStringBuilder using the provided builderAction and then converting it to SpannedString. |
Extension functions summary
For android.text.Spannable | |
Unit |
Clear all spans from this text. |
operator Unit | |
operator Unit |
For android.text.Spanned | |
Array<out T> |
Get all spans that are instance of T. |
String |
Returns a string of HTML from the spans in this Spanned. |
For kotlin.CharSequence | |
Boolean |
Returns whether the given CharSequence contains only digits. |
Spannable |
Returns a new Spannable from CharSequence, or the source itself if it is already an instance of SpannableString. |
Spanned |
Returns a new Spanned from CharSequence, or the source itself if it is already an instance of SpannedString. |
Int |
Returns the length that the specified CharSequence would have if spaces and ASCII control characters were trimmed from the start and end, as by String.trim. |
For kotlin.String | |
String |
Html-encode the string. |
Spanned |
String.parseAsHtml(flags: Int = FROM_HTML_MODE_LEGACY, imageGetter: ImageGetter? = null, tagHandler: TagHandler? = null) Returns a Spanned from parsing this string as HTML. |
Extension properties summary
For java.util.Locale | |
Int |
Returns layout direction for a given locale. |
Top-level functions
buildSpannedString
inline fun buildSpannedString(builderAction: SpannableStringBuilder.() -> Unit): SpannedString
Builds new string by populating a newly created SpannableStringBuilder using the provided builderAction and then converting it to SpannedString.
Extension functions
backgroundColor
inline fun SpannableStringBuilder.backgroundColor(
@ColorInt color: Int,
builderAction: SpannableStringBuilder.() -> Unit
): SpannableStringBuilder
Wrap appended text in builderAction in a BackgroundColorSpan.
See Also
bold
inline fun SpannableStringBuilder.bold(builderAction: SpannableStringBuilder.() -> Unit): SpannableStringBuilder
Wrap appended text in builderAction in a bold StyleSpan.
See Also