Support Maven:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.SwiftyWang:UnderLineLinkTextView:2.02'
}Support some of the key words can be clicked with the underline TextView
<declare-styleable name="AutoLinkStyleTextView">
<attr name="link_text_value" format="string|reference"/>
<attr name="link_text_color" format="color|reference"/>
<attr name="link_text_bg_color" format="color|reference"/>
<attr name="link_text_click_bg_color" format="color|reference"/>
<attr name="link_text_click_bg_auto_invalidate" format="boolean"/>
<attr name="link_has_under_line" format="boolean"/>
</declare-styleable>use, for example:
```xml ``` ```java autoLinkStyleTextView.setOnClickCallBack(new AutoLinkStyleTextView.ClickCallBack() { @Override public void onClick(int position) { if (position == 0) { Toast.makeText(MainActivity.this, "购买须知", Toast.LENGTH_SHORT).show(); } else if (position == 1) { Toast.makeText(MainActivity.this, "用户条款", Toast.LENGTH_SHORT).show(); } } }); ```  