HtmlCompat

Backwards compatible version of Html.

Properties

Link copied to clipboard
Flags for fromHtml: Separate block-level elements with line breaks (single newline character) in between.
Link copied to clipboard
Flags for fromHtml: Separate block-level elements with blank lines (two newline characters) in between.
Link copied to clipboard
Flag indicating that CSS color values should be used instead of those defined in Color.
Flag indicating that texts inside <blockquote> elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Flag indicating that texts inside <div>elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Flag indicating that texts inside <h1>~<h6> elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Flag indicating that texts inside <ul> elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Flag indicating that texts inside <li> elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Flag indicating that texts inside <p> elements will be separated from other texts with one newline character by default.
Link copied to clipboard
Option for fromHtml: Wrap consecutive lines of text delimited by '\n' inside <p> elements.
Link copied to clipboard
Option for fromHtml: Wrap each line of text delimited by '\n' inside a <p> or a <li> element.

Functions

Link copied to clipboard
@NonNull
open fun fromHtml(@NonNull source: @NonNull String, flags: Int): @NonNull Spanned
Invokes fromHtml on API 24 and newer, otherwise flags are ignored and fromHtml is used.
@NonNull
open fun fromHtml(@NonNull source: @NonNull String, flags: Int, @Nullable imageGetter: @Nullable Html.ImageGetter, @Nullable tagHandler: @Nullable Html.TagHandler): @NonNull Spanned
Invokes fromHtml on API 24 or newer, otherwise flags are ignored and fromHtml is used.
Link copied to clipboard
@NonNull
open fun toHtml(@NonNull text: @NonNull Spanned, options: Int): @NonNull String
Invokes toHtml on API 24 or newer, otherwise options are ignored and toHtml is used.