stefanhaustein / nativehtml

Renders HTML to native Android components.
Apache License 2.0
45 stars 6 forks source link
android html

NativeHtml

Renders HTML to native Android components. Easily extensible with custom native elements.

The main use case for this library is rendering HTML-formatted text or (custom) components in cases where TextView HTML capabilities are too limited and WebView is too heavyweight or not suitable for other reasons.

Use Cases

Limitations

Extensibility

Usage

For a simple example, please refer to the demo

Gradle

Jitpack for the win!

Step 1: Add jitpack to your root build.gradle at the end of repositories:

allprojects {
        repositories {
          ...
          maven { url 'https://jitpack.io' }
        }
    }

Step 2: Add the HtmlView2 dependency

dependencies {
    compile 'com.github.stefanhaustein.nativehtml:android:v1.0.6'
}