{"id":16558816,"url":"https://github.com/rebooters/linktextview","last_synced_at":"2025-03-16T20:30:26.094Z","repository":{"id":97475968,"uuid":"173517791","full_name":"REBOOTERS/LinkTextView","owner":"REBOOTERS","description":"Made TextView with clickable link easier","archived":false,"fork":false,"pushed_at":"2022-01-04T05:58:07.000Z","size":319,"stargazers_count":85,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T12:45:45.245Z","etag":null,"topics":["androdi-ui","android","clickablespan-in-clickable-textview","custom-view","link","textview"],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/REBOOTERS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-03-03T01:27:09.000Z","updated_at":"2024-12-11T00:45:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"b10a09e4-fc44-4c8b-84d1-b1d8796dd515","html_url":"https://github.com/REBOOTERS/LinkTextView","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REBOOTERS%2FLinkTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REBOOTERS%2FLinkTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REBOOTERS%2FLinkTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/REBOOTERS%2FLinkTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/REBOOTERS","download_url":"https://codeload.github.com/REBOOTERS/LinkTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826798,"owners_count":20354221,"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":["androdi-ui","android","clickablespan-in-clickable-textview","custom-view","link","textview"],"created_at":"2024-10-11T20:23:49.374Z","updated_at":"2025-03-16T20:30:26.088Z","avatar_url":"https://github.com/REBOOTERS.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LinkTextView\nMade TextView with **ClickableSpan** more easy\n\n[ ![Download](https://api.bintray.com/packages/rookieboy/maven/linktextview/images/download.svg?version=0.0.4) ](https://bintray.com/rookieboy/maven/linktextview/0.0.4/link)\n\n\u003cimg src=\"https://raw.githubusercontent.com/REBOOTERS/Images/master/LinkTextView/art.gif\"/\u003e\n\n\n\n## Gradle \n\n```groovy\nimplementation \"com.reoobter:linktextview:0.0.4\"\n```\n## Feature\nThanks for [VeerHan](https://github.com/VeerHan)‘s [PR](https://github.com/REBOOTERS/LinkTextView/pull/1) .Now we support match repeat word in some complex scenes. for example \n\n```java\nval androidRules = arrayOf(\"手机\", \"Linux\", \"操作系统\", \"移动设备\", \"智能手机\", \"平板电脑\", \"开放手机联盟\")\n```\nthe word \"手机\" is repeated in those keyword. when the word \"手机\" is clicked in ”智能手机“ or ”开发手机联盟“ ，it will be react as \"手机” ，while when \"智能手机\" and ”开发手机联盟“ clicked ,it will react as normal. \n\n## Usage\n\n\n#### noraml \n\nall clickable word with same color\n\n```kotlin\n// the content should be set for TextView\nval android = getString(R.string.text_android_baike) \n// Array to define all clickable words\nval androidRules = arrayOf(\"Linux\",\"操作系统\",\"移动设备\",\"智能手机\",\"平板电脑\",\"开放手机联盟\") \n\nLinker.Builder()\n    .content(android)\n    .textView(text_view_1)\n    .links(androidRules)\n    .linkColor(ContextCompat.getColor(this,R.color.link))\n    .addOnLinkClickListener(onLinkClickListener)\n    .apply()\n\nprivate val onLinkClickListener = object:OnLinkClickListener{\n    override fun onClick(view: View, content: String) {\n        Toast.makeText(mContext, \"clicked link is : $content\", Toast.LENGTH_SHORT).show()\n    }\n}\n\n```\n\n#### advance\n\nclickable word with different color\n\n\u003cimg src=\"https://raw.githubusercontent.com/REBOOTERS/Images/master/LinkTextView/linker_color.png\" width=40% /\u003e\n\n```kotlin\n\nval actorsRules1 = listOf(\n    Pair(\"刘仁娜\", ContextCompat.getColor(this, R.color.red)),\n    Pair(\"李栋旭\", ContextCompat.getColor(this, R.color.colorPrimary)),\n    Pair(\"吴政世\", ContextCompat.getColor(this, R.color.colorAccent)),\n    Pair(\"沈亨倬\", ContextCompat.getColor(this, R.color.colorPrimaryDark)),\n    Pair(\"吴义植\", ContextCompat.getColor(this, R.color.green)),\n    Pair(\"张基龙\", ContextCompat.getColor(this, R.color.blue)),\n    Pair(\"黄灿盛\", ContextCompat.getColor(this, R.color.yellow)),\n    Pair(\"金希珍\", ContextCompat.getColor(this, R.color.orange))\n)\n\nLinker.Builder()\n    .content(actors)\n    .textView(text_view_4_1)\n    .colorLinks(actorsRules1)\n    .shouldShowUnderLine(false)\n    .addOnLinkClickListener(onLinkClickListener)\n    .apply()\n\n```\n\n## API \n\n method | function | must invocation| defaultValue\n -------|  --------| ---------|------\n|content|content for TextView|yes| none|\n|textview|TextView used for set clickable words|yes| none|\n|links|String/Array\u003cString\u003e/List\u003cString\u003e to define clickable words |no| none|\n|linkColor|Color for clickable word|no| Color.Black|\n|colorLinks|supply a List of Pair,define both word and color |no|null|\n|shouldShowUnderLine|whether to show underline for clickable word|no| false|\n|addOnLinkClickListener|add a listener will callback once click the link word|no| null|\n|setLinkMovementMethod|add a custom LinkMovementMethod|no| internal|\n|bold|true means textStyle=\"bold\"|no| false|\n|apply|apply the function|yes| none|\n\n\n## TODO\n\n- [x] different color for links \n\n\n## License \n\n---------------------\n\n    Copyright 2019 REBOOTERS\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebooters%2Flinktextview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frebooters%2Flinktextview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebooters%2Flinktextview/lists"}