open-keychain/libraries/HtmlTextView
2014-01-16 22:33:11 +01:00
..
src/org/sufficientlysecure/htmltextview Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00
.gitignore Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00
AndroidManifest.xml Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00
build.gradle Update gradle build files to 0.7.3 android plugin, add Gradle 1.9 wrapper, add information about build to readme 2014-01-16 22:33:11 +01:00
build.xml update build files 2013-09-09 22:50:16 +02:00
LICENSE Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00
proguard-project.txt update build files 2013-09-09 22:50:16 +02:00
project.properties Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00
README.md Switch from HtmlSpanner to HtmlTextView 2013-09-09 13:16:54 +02:00

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.