AutoLinkTextViewV2
AutoLinkTextView is a TextView that supports automatic detection of Hashtags (#), Mentions (@) , URLs (http://), Phone Nubers and emails.
AutoLinkTextViewV2 is the new version of the [AutoLinkTextView].
The main differences between the old and new version are
- Fully migration to Kotlin
- Added several new features
- Some improvements and fixes
It supports automatic detection and click handling for
- Hashtags (#)
- Mentions (@)
- URLs (http://)
- Phone Numbers
- Emails
- Custom Regex
The current minSDK version is API level 16.
Download sample apk
Features
- Default support for Hashtag, Mention, Link, Phone number and Email
- Support for custom types via regex
- Transform url to short clickable text
- Ability to apply multiple spans to any mode
- Ability to set specific text color
- Ability to set pressed state color
Download
Gradle:
Setup and Usage
Add AutoLinkTextView to your layout
Add one or multiple modes
Add url transformations for transforming them to short clickable text
Or you can attach urlProcessor and transform it
Add one or multiple spans to specific mode
Set AutoLinkTextView click listener
Set text to AutoLinkTextView
Customizing
All possible modes
MODE_PHONE
MODE_HASHTAG
MODE_URL
MODE_MENTION
MODE_EMAIL
MODE_CUSTOM
For use of custom mode add custom regex
You can change text color for the specific mode
You can also change pressed text color