{"id":19300092,"url":"https://github.com/armcha/autolinktextviewv2","last_synced_at":"2025-10-23T23:24:14.553Z","repository":{"id":51529316,"uuid":"211641544","full_name":"armcha/AutoLinkTextViewV2","owner":"armcha","description":"AutoLinkTextView is a TextView that supports  automatic detection of Hashtags (#), Mentions (@) , URLs (http://), Phone Nubers and emails","archived":false,"fork":false,"pushed_at":"2021-05-11T11:03:20.000Z","size":17874,"stargazers_count":265,"open_issues_count":16,"forks_count":34,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T10:05:52.068Z","etag":null,"topics":["android","autolinktextview","regex","url-detection"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/armcha.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}},"created_at":"2019-09-29T09:53:34.000Z","updated_at":"2025-02-10T08:34:06.000Z","dependencies_parsed_at":"2022-08-03T06:01:40.714Z","dependency_job_id":null,"html_url":"https://github.com/armcha/AutoLinkTextViewV2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FAutoLinkTextViewV2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FAutoLinkTextViewV2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FAutoLinkTextViewV2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armcha%2FAutoLinkTextViewV2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armcha","download_url":"https://codeload.github.com/armcha/AutoLinkTextViewV2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"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":["android","autolinktextview","regex","url-detection"],"created_at":"2024-11-09T23:13:48.659Z","updated_at":"2025-10-23T23:24:14.481Z","avatar_url":"https://github.com/armcha.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoLinkTextView V2\n\n[1]: https://github.com/armcha/AutoLinkTextView\nAutoLinkTextViewV2 is the new version of the [AutoLinkTextView][1].\n\n**The main differences between the old and new version are**\n- Fully migration to Kotlin\n- Added several new features\n- Some improvements and fixes\n\n**It supports automatic detection and click handling for**\n* Hashtags (#)\n* Mentions (@) \n* URLs (https://)\n* Phone Numbers\n* Emails\n* Multiple Custom Regex\n\n.\u003cimg src=\"screens/static.png\" width=\"400\"\u003e\n\u003cimg src=\"screens/static_gif.gif\" width=\"400\"\u003e\n\nThe current minSDK version is API level 16.\n\n### Download sample [apk][77]\n[77]: https://github.com/armcha/AutoLinkTextViewV2/blob/master/screens/AutoLinkTextView.apk\n\n### Features\n\n* Default support for **Hashtag, Mention, Link, Phone number and Email**\n* Support for **custom types** via regex\n* Transform url to short clickable text\n* Ability to apply **multiple spans** to any mode\n* Ability to set specific text color\n* Ability to set pressed state color\n\n-----------------------\n\n### Download\n\nGradle:\n```groovy\nimplementation 'com.github.armcha:AutoLinkTextViewV2:3.0.0'\n```\n\n### Setup and Usage\n\nAdd AutoLinkTextView to your layout\n```xml\n\u003cio.github.armcha.autolink.AutoLinkTextView\n    android:id=\"@+id/autolinkTextView\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\" /\u003e\n```\n\n```kotlin\nval autoLinkTextView = findViewById\u003cAutoLinkTextView\u003e(R.id.autolinkTextView);\n```\n\nAdd one or multiple modes\n```kotlin\nautoLinkTextView.addAutoLinkMode(\n                MODE_HASHTAG,\n                MODE_URL)\n```\n-----------------------\nAdd url transformations for transforming them to short clickable text\n```kotlin\nautoLinkTextView.addUrlTransformations(\n                \"https://google.com\" to \"Google\",\n                \"https://en.wikipedia.org/wiki/Wear_OS\" to \"Wear OS\")\n```\n\nOr you can attach urlProcessor and transform it\n```kotlin\nautoLinkTextView.attachUrlProcessor { originalUrl: String -\u003e\n    when {\n        originalUrl.startsWith(\"https://en.wikipedia\") -\u003e \"Wiki\"\n        originalUrl.contains(\"android\") -\u003e \"Android\"\n        else -\u003e originalUrl\n    }\n}\n```\n\n\u003cimg src=\"screens/transformation_before.png\" width=\"400\"\u003e \u003cimg src=\"screens/transformation_after.png\" width=\"400\"\u003e\n-----------------------\nAdd one or multiple spans to specific mode\n```kotlin\nautoLinkTextView.addSpan(MODE_URL, StyleSpan(Typeface.ITALIC), UnderlineSpan())\nautoLinkTextView.addSpan(MODE_HASHTAG, UnderlineSpan(), TypefaceSpan(\"monospace\"))\n```\n-----------------------\nSet AutoLinkTextView click listener\n```kotlin\nautoLinkTextView.onAutoLinkClick { item: AutoLinkItem -\u003e\n}\n```\n-----------------------\nSet text to AutoLinkTextView\n```kotlin\nautoLinkTextView.text = getString(R.string.android_text)\n```\n\n\nCustomizing\n---------\n\nAll possible modes\n\n#### MODE_PHONE\n\n\u003cimg src=\"screens/phone.png\" width=\"400\"\u003e\n\n#### MODE_HASHTAG\n\n\u003cimg src=\"screens/hashtag.png\" width=\"400\"\u003e\n\n#### MODE_URL\n\n\u003cimg src=\"screens/url.png\" width=\"400\"\u003e\n\n#### MODE_MENTION\n\n\u003cimg src=\"screens/mention.png\" width=\"400\"\u003e\n\n#### MODE_EMAIL\n\n\u003cimg src=\"screens/gmail.png\" width=\"400\"\u003e\n\n#### MODE_CUSTOM\n\n\u003cimg src=\"screens/custom.png\" width=\"400\"\u003e\n\nFor use of custom mode you can add multiple custom regex\n\n```kotlin\nval custom = MODE_CUSTOM(\"\\\\sAndroid\\\\b\", \"\\\\sGoogle\\\\b\")\n```\n-------------------------\nYou can change text color for the specific mode\n```kotlin\nautoLinkTextView.hashTagModeColor = ContextCompat.getColor(this, R.color.color2)\nautoLinkTextView.phoneModeColor = ContextCompat.getColor(this, R.color.color3)\n```\n-------------------------\nYou can also change pressed text color\n```kotlin\nautoLinkTextView.pressedTextColor = ContextCompat.getColor(this, R.color.pressedTextColor)\n```\n\n### Contact :book:\n\n:arrow_forward:  **Email**: chatikyana@gmail.com\n\n:arrow_forward:  **LinkedIn**: https://www.linkedin.com/in/chatikyan\n\n:arrow_forward:  **Medium**: https://medium.com/@chatikyan\n\n:arrow_forward:  **Twitter**: https://twitter.com/ChatikyanArman\n\nLicense\n--------\n\n\n      Auto Link TextView V2 library for Android\n      Copyright (c) 2021 Arman Chatikyan (https://github.com/armcha/AutoLinkTextViewV2).\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmcha%2Fautolinktextviewv2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmcha%2Fautolinktextviewv2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmcha%2Fautolinktextviewv2/lists"}