Skip to content

Commit ed02b99

Browse files
authored
Update README.md
1 parent afe44f6 commit ed02b99

1 file changed

Lines changed: 35 additions & 4 deletions

File tree

README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,21 @@ SDHtmlTextView use HTMLSpanner to display properly in TextViews an html page, ov
6565

6666
## Usage
6767

68-
**Add the library as a dependency**
68+
1. **Add the library as a dependency**
6969

70-
1. in **Project level `build.gradle`** add those repositories
70+
1.1 in **Project level `build.gradle`** add those repositories
7171
```gradle
7272
maven { url 'https://dl.bintray.com/sysdata/maven' }
7373
mavenCentral()
7474
maven { url 'http://repo.pageturner-reader.org' }
7575
```
76-
2. in your **App level `build.gradle`** add this dependecy
76+
1.2 in your **App level `build.gradle`** add this dependecy
7777
```gradle
78-
implementation 'it.sysdata.mobile:HtmlSpanner:1.0.0'
78+
implementation 'it.sysdata.mobile:htmlspanner:1.0.0'
7979
```
80+
81+
1.3 Use HtmlSpanner in your TextView :
82+
8083
In the xml layout file define a simple TextView then in the Activity do
8184

8285
```java
@@ -91,8 +94,36 @@ If you want to handle href you need to add
9194
```java
9295
tv.setMovementMethod(LinkMovementMethod.getInstance());
9396
```
97+
You can also use an **SDHtmlTextView** instead of text view :
98+
99+
1. **Add the library as a dependency**
100+
101+
1.1 in **Project level `build.gradle`** add those repositories
102+
```gradle
103+
maven { url 'https://dl.bintray.com/sysdata/maven' }
104+
mavenCentral()
105+
maven { url 'http://repo.pageturner-reader.org' }
106+
```
107+
1.2 in your **App level `build.gradle`** add this dependecy
108+
```gradle
109+
implementation 'it.sysdata.mobile:htmltextview:1.0.0'
110+
```
111+
1.3 add the SDHtmlTextView via xml and then in your code set the html
112+
113+
**kotlin:**
94114

115+
```java
116+
String html=loadStringFromAssetFile(this,"example.html")
117+
htmlTextView.htmlText = html
118+
```
95119

120+
**java:**
121+
122+
```java
123+
String html=loadStringFromAssetFile(this,"example.html");
124+
SDHtmlTextView htmlTextView = (SDHtmlTextView) findViewById(R.id.text);
125+
htmlTextView.setHtmlText(html);
126+
```
96127

97128
## License
98129
Copyright (C) 2017 Sysdata S.p.A.

0 commit comments

Comments
 (0)