You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can alternatively use a builder to initialize the HtmlSpanner
102
+
103
+
```java
104
+
HtmlSpanner htmlSpanner =newHtmlSpanner.Builder()
105
+
.textColor(tv.getCurrentTextColor())
106
+
.textSize(tv.getTextSize())
107
+
.backgroundColor(tv.getSolidColor())
108
+
.tableHeaderCenter(isTableHeaderCentered)
109
+
.build();
110
+
```
111
+
112
+
the builder possible parameters are:
113
+
- textColor, this attribute is required since is used to initialize the htmlspanner with a custom text color;
114
+
- textSize, this attribute is required since is used to initialize the htmlspanner with a custom text size;
115
+
- backgroundColor, this attribute is required since is used to initialize the htmlspanner with a custom background color to handle html tags like "div" correctly;
116
+
- tableHeaderCenter, if this attribute is set to false or true it will define the centering of the table header fields in tables, by default table header is centered.
117
+
101
118
2. Alternatively you can use an **SDHtmlTextView** which is a custom TextView that integrates HtmlSpanner to handle html texts :
102
119
103
120
2.1 **Add the library as a dependency**
@@ -117,7 +134,7 @@ If you want to handle href you need to add
0 commit comments