本项目结合SufficientlySecure/html-textview version 4.0 和xiandanin /html-textview 来满足实际项目中开发需求,只是做了简单的拼接,特此感谢两位作者
implementation 'com.github.adiaos-team:HtmlTextView:1.0'
以下为xiandanin/html-textview 的README
- 支持
<span>; - 支持
<a>自定义URL点击事件; <u><strong>等等其它文字类型的标签也支持style;- 支持
rgb(255, 255, 255)的颜色格式.
- 不支持
<table>; 不支持;(已在7cd2f35支持)<img>- 嵌套
<ol>、<ul>间距不正确; <li>不支持样式。
implementation 'com.github.adiaos-team:HtmlTextView:1.0'
//在setHtml之前调用
textView.setOnClickUrlListener(new OnClickUrlListener() {
@Override
public boolean onClickUrl(View widget, String url) {
Toast.makeText(MainActivity.this, url, Toast.LENGTH_SHORT).show();
return true;
}
});
PrivacyApps/html-textview
NightWhistler/HtmlSpanner
- added support for
<span>; - added
<a>url custom click event; - let
<u><strong>and other text type tags support Inline style; - support the color format of
rgb(255, 255, 255).
<table>is not supported;; (it is supported in 7cd2f35)<img>is not supported- nested
<ol>,<ul>spacing is incorrect; <li>does not support styles.
implementation 'com.dyhdyh.support:html-textview:3.6.2'
//called before setHtml
textView.setOnClickUrlListener(new OnClickUrlListener() {
@Override
public boolean onClickUrl(View widget, String url) {
Toast.makeText(MainActivity.this, url, Toast.LENGTH_SHORT).show();
return true;
}
});