Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support some of the key words can be clicked with the underline TextView

Notifications You must be signed in to change notification settings

jonenet/UnderLineLinkTextView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

18 Commits

Repository files navigation

UnderLineLinkTextView

Support some of the key words can be clicked with the underline TextView

 <declare-styleable name="AutoLinkStyleTextView">
    <attr name="AutoLinkStyleTextView_text_value" format="string|reference"/>//key word with color and underline, and split with ','(en)
 <attr name="AutoLinkStyleTextView_default_color" format="color|reference"/>//word and underline's color
 <attr name="AutoLinkStyleTextView_has_under_line" format="boolean"/>//underline with true and false
 </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(); } } }); ``` ![](https://github.com/wangshaolei/UnderLineLinkTextView/blob/master/img/1.png) ![](https://github.com/wangshaolei/UnderLineLinkTextView/blob/master/img/2.png)

About

Support some of the key words can be clicked with the underline TextView

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%

AltStyle によって変換されたページ (->オリジナル) /