open-keychain/libraries/HtmlTextView
2014-01-29 01:49:59 +01:00
..
src/org/sufficientlysecure/htmltextview
.gitignore
AndroidManifest.xml
build.gradle Update gradle build files to use android plugin 0.8.0, build tools 19.0.1 2014-01-29 01:49:59 +01:00
build.xml
LICENSE
proguard-project.txt
project.properties small code restructures 2014-01-29 01:38:34 +01:00
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.