Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

AutoSpannableTextView

> 编程语言
Open source

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

361 stars0 likes1 views
WebsiteGitHub

About

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

AutoSpannableTextView

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

Step1:

xml
    
        //key word with color and underline, and split with ','(en)
        //word and underline's color
        //underline with true and false
        //start with image 's TextView
        
            
            //default
        
    

Step2:

xml
    //style1
    
    //style2
    

Step3:

java

    //style1
    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();
            }
        }
     });
     
     //style2
     setStartImageText(tvStartImage.getText());

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言