open-keychain/libraries/HtmlTextView
..
src/org/sufficientlysecure/htmltextview
.gitignore
AndroidManifest.xml
build.gradle
build.xml
LICENSE
proguard-project.txt
project.properties
README.md

HtmlTextView for Android

This HtmlTextView supports all HTML tags supported by Android's Html class (see The CommonsBlog and history of Html class for newer additions). Additionally, list tags are supported (<ul>, <ol>, <dd>) and code tags with <code>.

This also includes a workaround to prevent TextView crashing on specific Android versions.

This library is kept very tiny with no external dependencies. I am using it to provide Help/About Activities in my apps.

Example

HtmlTextView text = new HtmlTextView(this);

// loads html from string
text.setHtmlFromString("<b>Hello</b><ul><li>world</li><li>cats</li></ul>");

or

HtmlTextView text = new HtmlTextView(this);

// loads html from raw resource, i.e., a html file in res/raw/, this allows translatable resource (e.g., res/raw-de/ for german)
text.setHtmlFromRawResource(this, R.raw.help);

Use library as Gradle dependency (Android library project)

  1. Copy this folder to your project and include it in settings.gradle with include ':html-textview'
  2. Add dependency compile project(':html-textview') to your project's build.gradle.

License

Apache License v2

Authors

Contributions

Feel free to fork and do pull requests. I am more than happy to merge them. Please do not introduce external dependencies.