Enhanced library for Android's Html class. Reference to library HtmlCompat.
All the latest functionality from the current Html for Android Nougat is included in this library. While this may continue to be improved in the future, currently, the following tags are supported out of the box:
<br><p><ul><li><div><span><img><strong><b><em><i><u><s><strike><del><cite><dfn><big><small><font><blockquote><tt><a><sup><sub><h1><h2><h3><h4><h5><h6>
The following CSS inline styles are supported:
text-align(left, right, center, start, end)colorwidthheightbackground,background-colortext-decoration(line-through, underline)
All CSS color declarations as defined here are supported.
This library support LaTeX formula like this:
<span class="mathquill-embedded-latex" style="width: 170px; height: 50px;">x=\frac{-b\pm\sqrt[2]{b^2-4ac}}{2a}</span>which can be generated by the UEditor or other editor like this.
It uses JLaTeXMath to support LaTeX.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}Step 2. Add the dependency in your module's build.gradle
dependencies {
compile 'com.github.kniost:EnhancedHtml:[VERSION_HERE]'
}If you need to use LaTeX, you have initialize JLaTeXMath for LaTeX rendering by command:
AjLatexMath.init(context); // init library: load fonts, create paint, etc.A sample usage:
Spanned spannableString = EnhancedHtml.fromHtml(mContext,
TEST_STRING,
0,
CustomImageGetter,
CustomTagHandler);
mTestTv.setText(spannableString);