{"id":13644433,"url":"https://github.com/wangshaolei/AutoSpannableTextView","last_synced_at":"2025-04-21T07:31:23.985Z","repository":{"id":217102629,"uuid":"70472458","full_name":"wangshaolei/AutoSpannableTextView","owner":"wangshaolei","description":"Support some of the key words can be clicked with the underline TextView","archived":false,"fork":false,"pushed_at":"2017-09-22T02:50:09.000Z","size":141,"stargazers_count":366,"open_issues_count":4,"forks_count":50,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-08-04T00:06:52.321Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangshaolei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-10T09:22:40.000Z","updated_at":"2024-08-02T07:36:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"35548127-5d15-4a72-97a2-0548e6630cf0","html_url":"https://github.com/wangshaolei/AutoSpannableTextView","commit_stats":null,"previous_names":["wangshaolei/autospannabletextview","wangshaolei/underlinelinktextview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangshaolei%2FAutoSpannableTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangshaolei%2FAutoSpannableTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangshaolei%2FAutoSpannableTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangshaolei%2FAutoSpannableTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangshaolei","download_url":"https://codeload.github.com/wangshaolei/AutoSpannableTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014630,"owners_count":21360984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:04.363Z","updated_at":"2025-04-21T07:31:18.975Z","avatar_url":"https://github.com/wangshaolei.png","language":"Java","readme":"# AutoSpannableTextView\nSupport some of the key words can be clicked with the underline TextView\u003cbr\u003e\n\n\nStep1：\n\n```xml\n    \u003cdeclare-styleable name=\"AutoLinkStyleTextView\"\u003e\n        \u003cattr name=\"AutoLinkStyleTextView_text_value\" format=\"string|reference\"/\u003e//key word with color and underline, and split with ','(en)\n        \u003cattr name=\"AutoLinkStyleTextView_default_color\" format=\"color|reference\"/\u003e//word and underline's color\n        \u003cattr name=\"AutoLinkStyleTextView_has_under_line\" format=\"boolean\"/\u003e//underline with true and false\n        \u003cattr name=\"AutoLinkStyleTextView_start_image\" format=\"reference\"/\u003e//start with image 's TextView\n        \u003cattr name=\"AutoLinkStyleTextView_type\"\u003e\n            \u003cenum name=\"start_image\" value=\"0\"/\u003e\n            \u003cenum name=\"content_text\" value=\"1\"/\u003e//default\n        \u003c/attr\u003e\n    \u003c/declare-styleable\u003e\n```\n\u003cbr\u003e\n\nStep2：\n\n```xml\n    //style1\n    \u003cxx.AutoLinkStyleTextView\n        android:id=\"@+id/tv_clause\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"我已核对付款金额，仔细阅读并同意“购买须知”及约克论坛团购“用户条款”\"\n        android:textSize=\"16sp\"\n        app:AutoLinkStyleTextView_text_value=\"“购买须知”,“用户条款”\"\n        /\u003e\n    //style2\n    \u003cxx.AutoLinkStyleTextView\n        android:id=\"@+id/tv_start_image\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"活动介绍，开始以图片开头\"\n        android:textSize=\"16sp\"\n        app:AutoLinkStyleTextView_start_image=\"@mipmap/ic_qupai_subject_information\"\n        app:AutoLinkStyleTextView_type=\"start_image\"\n        /\u003e\n\n```\nStep3：\n\n```java\n\n    //style1\n    autoLinkStyleTextView.setOnClickCallBack(new AutoLinkStyleTextView.ClickCallBack() {\n        @Override\n        public void onClick(int position) {\n            if (position == 0) {\n                Toast.makeText(MainActivity.this, \"购买须知\", Toast.LENGTH_SHORT).show();\n            } else if (position == 1) {\n                Toast.makeText(MainActivity.this, \"用户条款\", Toast.LENGTH_SHORT).show();\n            }\n        }\n     });\n     \n     //style2\n     setStartImageText(tvStartImage.getText());\n```\n\n![](https://github.com/wangshaolei/UnderLineLinkTextView/blob/master/img/1.png)\n![](https://github.com/wangshaolei/UnderLineLinkTextView/blob/master/img/2.png)\n![](https://github.com/wangshaolei/UnderLineLinkTextView/blob/master/img/3.png)\n","funding_links":[],"categories":["TextView"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangshaolei%2FAutoSpannableTextView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangshaolei%2FAutoSpannableTextView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangshaolei%2FAutoSpannableTextView/lists"}