Skip to content

Commit 33d8284

Browse files
authored
Update README.md
1 parent 9a341f1 commit 33d8284

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ SDHtmlTextView use HTMLSpanner to display properly in TextViews an html page, ov
7070
1.1 in **Project level `build.gradle`** add those repositories
7171
```gradle
7272
maven { url 'https://dl.bintray.com/sysdata/maven' }
73-
mavenCentral()
7473
maven { url 'http://repo.pageturner-reader.org' }
74+
mavenCentral()
7575
```
7676
1.2 in your **App level `build.gradle`** add this dependecy
7777
```gradle
7878
implementation 'it.sysdata.mobile:htmlspanner:1.0.0'
79+
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.16'
7980
```
8081

8182
1.3 Use HtmlSpanner in your TextView :
@@ -86,7 +87,7 @@ In the xml layout file define a simple TextView then in the Activity do
8687
String html=loadStringFromAssetFile(this,"example.html");
8788
TextView tv = (TextView) findViewById(R.id.text);
8889
int col=tv.getSolidColor();
89-
HtmlSpanner htmlSpanner=new HtmlSpanner();
90+
HtmlSpanner htmlSpanner=new HtmlSpanner(tv.getCurrentTextColor(), tv.getTextSize());
9091
htmlSpanner.setBackgroundColor(col);
9192
tv.setText(htmlSpanner.fromHtml(html));
9293
```
@@ -101,12 +102,13 @@ You can also use an **SDHtmlTextView** instead of text view :
101102
1.1 in **Project level `build.gradle`** add those repositories
102103
```gradle
103104
maven { url 'https://dl.bintray.com/sysdata/maven' }
104-
mavenCentral()
105105
maven { url 'http://repo.pageturner-reader.org' }
106+
mavenCentral()
106107
```
107108
1.2 in your **App level `build.gradle`** add this dependecy
108109
```gradle
109110
implementation 'it.sysdata.mobile:htmltextview:1.0.0'
111+
implementation 'net.sourceforge.htmlcleaner:htmlcleaner:2.16'
110112
```
111113
1.3 add the SDHtmlTextView via xml and then in your code set the html
112114

0 commit comments

Comments
 (0)