HtmlCompat
class HtmlCompat
kotlin.Any | |
↳ | androidx.core.text.HtmlCompat |
Backwards compatible version of Html
.
Summary
Constants | |
---|---|
static Int |
Flags for |
static Int |
Flags for |
static Int |
Flag indicating that CSS color values should be used instead of those defined in |
static Int |
Flag indicating that texts inside <blockquote> elements will be separated from other texts with one newline character by default. |
static Int |
Flag indicating that texts inside <div> elements will be separated from other texts with one newline character by default. |
static Int |
Flag indicating that texts inside <h1>~<h6> elements will be separated from other texts with one newline character by default. |
static Int |
Flag indicating that texts inside <ul> elements will be separated from other texts with one newline character by default. |
static Int |
Flag indicating that texts inside <li> elements will be separated from other texts with one newline character by default. |
static Int |
Flag indicating that texts inside <p> elements will be separated from other texts with one newline character by default. |
static Int |
Option for |
static Int |
Option for |
Public methods | |
---|---|
static Spanned |
Invokes |
static Spanned |
fromHtml(@NonNull source: String, flags: Int, @Nullable imageGetter: ImageGetter?, @Nullable tagHandler: TagHandler?) Invokes |
static String |
Invokes |
Constants
FROM_HTML_MODE_COMPACT
static val FROM_HTML_MODE_COMPACT: Int
Flags for fromHtml(String, int, ImageGetter, TagHandler)
: Separate block-level elements with line breaks (single newline character) in between. This inverts the Spanned
to HTML string conversion done with the option TO_HTML_PARAGRAPH_LINES_INDIVIDUAL
.
Value: Html.FROM_HTML_MODE_COMPACT
FROM_HTML_MODE_LEGACY
static val FROM_HTML_MODE_LEGACY: Int
Flags for fromHtml(String, int, ImageGetter, TagHandler)
: Separate block-level elements with blank lines (two newline characters) in between. This is the legacy behavior prior to N.
Value: Html.FROM_HTML_MODE_LEGACY
FROM_HTML_OPTION_USE_CSS_COLORS
static val FROM_HTML_OPTION_USE_CSS_COLORS: Int
Flag indicating that CSS color values should be used instead of those defined in Color
.
Value: Html.FROM_HTML_OPTION_USE_CSS_COLORS
FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE
static val FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE: Int
Flag indicating that texts inside <blockquote> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_BLOCKQUOTE
FROM_HTML_SEPARATOR_LINE_BREAK_DIV
static val FROM_HTML_SEPARATOR_LINE_BREAK_DIV: Int
Flag indicating that texts inside <div> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_DIV
FROM_HTML_SEPARATOR_LINE_BREAK_HEADING
static val FROM_HTML_SEPARATOR_LINE_BREAK_HEADING: Int
Flag indicating that texts inside <h1>~<h6> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_HEADING
FROM_HTML_SEPARATOR_LINE_BREAK_LIST
static val FROM_HTML_SEPARATOR_LINE_BREAK_LIST: Int
Flag indicating that texts inside <ul> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_LIST
FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM
static val FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM: Int
Flag indicating that texts inside <li> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_ITEM
FROM_HTML_SEPARATOR_LINE_BREAK_PARAGRAPH
static val FROM_HTML_SEPARATOR_LINE_BREAK_PARAGRAPH: Int
Flag indicating that texts inside <p> elements will be separated from other texts with one newline character by default.
Value: Html.FROM_HTML_SEPARATOR_LINE_BREAK_PARAGRAPH
TO_HTML_PARAGRAPH_LINES_CONSECUTIVE
static val TO_HTML_PARAGRAPH_LINES_CONSECUTIVE: Int
Option for fromHtml(String, int)
: Wrap consecutive lines of text delimited by '\n' inside <p> elements. BulletSpan
s are ignored.
Value: Html.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE