HtmlCompat

public final class HtmlCompat


Backwards compatible version of Html.

Summary

Constants

static final int

Flags for fromHtml: Separate block-level elements with line breaks (single newline character) in between.

static final int

Flags for fromHtml: Separate block-level elements with blank lines (two newline characters) in between.

static final int

Flag indicating that CSS color values should be used instead of those defined in Color.

static final int

Flag indicating that texts inside

elements will be separated from other texts with one newline character by default.

static final int

Flag indicating that texts inside

elements will be separated from other texts with one newline character by default.

static final int

Flag indicating that texts inside

~

elements will be separated from other texts with one newline character by default.

static final int

Flag indicating that texts inside

    elements will be separated from other texts with one newline character by default.

static final int

Flag indicating that texts inside

  • elements will be separated from other texts with one newline character by default.

  • static final int

    Flag indicating that texts inside

    elements will be separated from other texts with one newline character by default.

    static final int

    Option for fromHtml: Wrap consecutive lines of text delimited by '\n' inside

    elements.

    static final int

    Option for fromHtml: Wrap each line of text delimited by '\n' inside a

    or a

  • element.

  • Public constructors

    Public methods

    static @NonNull Spanned

    Invokes fromHtml on API 24 and newer, otherwise flags are ignored and fromHtml is used.

    static @NonNull Spanned
    fromHtml(
        @NonNull String source,
        @HtmlCompat.FromHtmlFlags int flags,
        @Nullable