https://github.com/omega-r/omegahtmltaghandler
https://github.com/omega-r/omegahtmltaghandler
android html library parser
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/omega-r/omegahtmltaghandler
- Owner: Omega-R
- Created: 2017-07-05T15:02:50.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T12:26:45.000Z (almost 9 years ago)
- Last Synced: 2025-04-24T06:36:29.397Z (about 1 year ago)
- Topics: android, html, library, parser
- Language: Java
- Size: 134 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://jitpack.io/#Omega-R/OmegaHtmlTagHandler)
# OmegaHtmlTagHandler
OmegaHtmlTagHandler is handler for html tag, which can load and converts it into Spannable for displaying it.
It is a addition for usage of the fromHtml, which can not process all tags
OmegaHtmlTagHandler allows you control over how tags are rendered. Allows proper handling of tables (support tag: table, tr, th, td)
# HTML

# Textview

# Installation
To get a Git project into your build:
**Step 1.** Add the JitPack repository to your build file
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
**Step 2.** Add the dependency
```
dependencies {
compile 'com.github.Omega-R:OmegaHtmlTagHandler:v1.0'
}
```
# Usage
Example of usage
```
OmegaHtmlTagHandler handler = new OmegaHtmlTagHandler();
Spanned spanned;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
spanned = Html.fromHtml(mHtmlTable, Html.FROM_HTML_MODE_LEGACY, null, handler);
} else {
spanned = Html.fromHtml(mHtmlTable, null, handler);
}
textViewHtmlTable.setText(spanned);
```
You also can delete specific spaces in table if needs, and can set type space:
```
handler.deleteSpecificSpaces(true, "\\\\n");
```
And can set specifies what character will be between the rows of the table:
```
handler.setSymbolsBetweenTableRows("\n");
```