Linkable Text Library
You can download Linkable Text Sample application on Google Play.
Download
Download the latest JAR or grab via Maven:
<dependency>
<groupId>com.github.fobid</groupId>
<artifactId>linkable-text</artifactId>
<version>0.2.0</version>
</dependency>
or Gradle:
implementation 'com.github.fobid:linkable-text:0.2.0'
Usage
<com.github.fobid.linkabletext.widget.LinkableTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
If you don't want to set link, then add app:enabledLinks="false"
in your xml. Or, LinkableTextView.setEnabledLinks(false)
in your code.
You must call LinkableTextView.setOnLinkClickListener()
after setText()
to set links clickable.
Attributes
<com.github.fobid.linkabletext.widget.LinkableTextView
xmlns:linkable="http://schemas.android.com/apk/res-auto"
android:id="@android:id/text1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
linkable:enabledLinks="false" />
You can make all links to be disabled with enabledLinks=false
in your layout xml or setEnabledLinks(false)
in your code. Every links are able to be set disabled on each.
If you remove all of underlines, then use enabledUnderlines=false
in your layout xml or setEnabledUnderlines(false)
in your code. It is also supported to each links.
Default value of all links and underlines is true
License
Copyright 2016 fobidlim
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.