Skip to content

Commit 90bbdbf

Browse files
author
Salvatore Ranieri
committed
updated readme
1 parent 905d045 commit 90bbdbf

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,22 +64,23 @@ SDHtmlTextView use HTMLSpanner to display properly in TextViews an html page, ov
6464
* ``text-decoration`` only underline and line-through
6565

6666
## Usage
67+
1. If you already have an implementation of TextView you could simply use HtmlSpanner, that wrap only the html code and convert it to a spannable string.
6768

68-
1. **Add the library as a dependency**
69+
1.1. **Add the library as a dependency**
6970

70-
1.1 in **Project level `build.gradle`** add those repositories
71+
1.1.1 in **Project level `build.gradle`** add those repositories
7172
```gradle
7273
maven { url 'https://dl.bintray.com/sysdata/maven' }
7374
maven { url 'http://repo.pageturner-reader.org' }
7475
mavenCentral()
7576
```
76-
1.2 in your **App level `build.gradle`** add this dependecy
77+
1.1.2 in your **App level `build.gradle`** add this dependecy
7778
```gradle
7879
implementation 'it.sysdata.mobile:htmlspanner:1.0.0'
7980
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.16'
8081
```
8182

82-
1.3 Use HtmlSpanner in your TextView :
83+
1.2 Use HtmlSpanner in your TextView :
8384

8485
In the xml layout file define a simple TextView then in the Activity do
8586

@@ -91,26 +92,28 @@ In the xml layout file define a simple TextView then in the Activity do
9192
htmlSpanner.setBackgroundColor(col);
9293
tv.setText(htmlSpanner.fromHtml(html));
9394
```
95+
9496
If you want to handle href you need to add
9597
```java
9698
tv.setMovementMethod(LinkMovementMethod.getInstance());
9799
```
98-
You can also use an **SDHtmlTextView** instead of text view :
99100

100-
1. **Add the library as a dependency**
101+
2. Alternatively you can use an **SDHtmlTextView** which is a custom TextView that integrates HtmlSpanner to handle html texts :
102+
103+
2.1 **Add the library as a dependency**
101104

102-
1.1 in **Project level `build.gradle`** add those repositories
105+
2.1.1 in **Project level `build.gradle`** add those repositories
103106
```gradle
104107
maven { url 'https://dl.bintray.com/sysdata/maven' }
105108
maven { url 'http://repo.pageturner-reader.org' }
106109
mavenCentral()
107110
```
108-
1.2 in your **App level `build.gradle`** add this dependecy
111+
2.1.2 in your **App level `build.gradle`** add this dependecy
109112
```gradle
110113
implementation 'it.sysdata.mobile:htmltextview:1.0.0'
111114
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.16'
112115
```
113-
1.3 add the SDHtmlTextView via xml and then in your code set the html
116+
2.2 add the SDHtmlTextView via xml and then in your code set the html
114117

115118
**kotlin:**
116119

0 commit comments

Comments
 (0)