@@ -70,12 +70,13 @@ SDHtmlTextView use HTMLSpanner to display properly in TextViews an html page, ov
70701.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```
76761.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
81821.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 :
1011021.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```
1071081.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```
1111131.3 add the SDHtmlTextView via xml and then in your code set the html
112114
0 commit comments