All Projects → StephenVinouze → Linkifiedtextview

StephenVinouze / Linkifiedtextview

Licence: apache-2.0
An extended TextView that allows you to detect several types of links such as urls, hashtags, phone numbers, etc.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Linkifiedtextview

Stacklabel
🔥空祖家的堆叠标签(以下碎念:一开始起名字“StackLabel”没想太多结果被人吐槽Stack是整齐堆叠的意思...........好吧这是我的锅不过现在要改也来不及了,好用就行了...吧?
Stars: ✭ 471 (+5133.33%)
Mutual labels:  textview
Expandabletextview
Android TextView that can expand and collapse.
Stars: ✭ 632 (+6922.22%)
Mutual labels:  textview
Android Robototextview
Implementation of a TextView and all its direct/indirect subclasses with native support for the Roboto fonts, includes the brand new Roboto Slab fonts.
Stars: ✭ 791 (+8688.89%)
Mutual labels:  textview
Htmlbuilder
Build valid HTML for Android TextView
Stars: ✭ 506 (+5522.22%)
Mutual labels:  textview
Htextview
Animation effects to text, not really textview
Stars: ✭ 5,309 (+58888.89%)
Mutual labels:  textview
Android Ago
An Android TextView that always displays an auto refreshing relative time span with respect to a reference time
Stars: ✭ 669 (+7333.33%)
Mutual labels:  textview
Text Decorator
Decorate your TextView easily
Stars: ✭ 402 (+4366.67%)
Mutual labels:  textview
Android Justifiedtextview
android justified textview
Stars: ✭ 917 (+10088.89%)
Mutual labels:  textview
Selectabletextview
A text view that supports selection and expansion
Stars: ✭ 626 (+6855.56%)
Mutual labels:  textview
Rxmarkdown
📠Markdown for Android, supports TextView && EditText (Live Preview), supports code high light.
Stars: ✭ 714 (+7833.33%)
Mutual labels:  textview
Kotlinextensions.com
A handy collection of most commonly used Kotlin extensions to boost your productivity.
Stars: ✭ 522 (+5700%)
Mutual labels:  textview
Textviewexpandableanimation
Expandable TextView With Smooth Transition Animation
Stars: ✭ 537 (+5866.67%)
Mutual labels:  textview
Wmzdialog
功能最多样式最多的弹窗,支持普通/微信底部/日期/地区/日历/选择/编辑/分享/菜单/自定义弹窗等,支持多种动画,链式编程调用(Pop-up windows with the most functions and styles, support normal/WeChat bottom/date/region/calendar/select/edit/share/menu/custom pop-up windows, etc., support multiple animations, chain programming calls)
Stars: ✭ 673 (+7377.78%)
Mutual labels:  textview
Flipview
Flipping views like Gmail & beyond
Stars: ✭ 477 (+5200%)
Mutual labels:  textview
Rskgrowingtextview
A light-weight UITextView subclass that automatically grows and shrinks.
Stars: ✭ 820 (+9011.11%)
Mutual labels:  textview
Inputkit
📝InputKit, an Elegant Kit to limits your input text, inspired by BlocksKit, written in both Objective-C & ⚡️Swift.
Stars: ✭ 420 (+4566.67%)
Mutual labels:  textview
Gsyricktext
类似微博的emoji表情、@人、话题等的EdiText,优化了编辑框中的光标点击和删除处理。TextView支持emoji表情、话题、链接、电话和@某人特殊显示的文本。
Stars: ✭ 651 (+7133.33%)
Mutual labels:  textview
Justifytextview
Deprecated
Stars: ✭ 25 (+177.78%)
Mutual labels:  textview
Roundprogresstextview
TextView with Round Pogress
Stars: ✭ 18 (+100%)
Mutual labels:  textview
Better Link Movement Method
Attempts to improve how clickable links are detected, highlighted and handled in TextView
Stars: ✭ 684 (+7500%)
Mutual labels:  textview

Release API GitHub license

LinkifiedTextView

This library intends to leverage what Linkify does but directly embedded inside a TextView with some preconfigured detectable link types.

Moreover, Linkify has a most often unwanted behavior that intercept touches inside the whole TextView instead of only the links that matches the activated link types. Hence, using Linkify results in a nearly non-clickable view. This is particularly annoying while working with a list of items that contains a big TextView inside.

It also comes with an utility TextView class that lets you easily define your custom fonts. This comes very handy while using iconic fonts!

alt tag alt tag

Download

Add this in your root build.gradle file:

allprojects {
	repositories {
		// ... other repositories
		maven { url "https://jitpack.io" }
	}
}

Then add the dependencies that you need in your project.

compile 'com.github.stephenvinouze:linkifiedtextview:{latest_version}'

Usage

TextView that detects links

Detecting links inside your TextView can be achieved by using the LinkTextView class

<com.stephenvinouze.linkifiedtextview.LinkTextView
            android:id="@+id/web_link"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:tvLinkText="<your_link_text>" // Mandatory : If you want the links to be detected you must use this property
            app:tvLinkTextColor="<your_link_color>" // Optional : default is Color.BLUE
            app:tvLinkType="<your_link_type>"/> // Optional : default is none, can be a combination of web|hashtag|screenname|email or all

You can listen to link click events using the OnLinkClickListener interface

LinkTextView webLink = (LinkTextView)findViewById(R.id.web_link);
webLink.setOnLinkClickListener(new OnLinkClickListener() {
    @Override
    public void onLinkClick(View textView, String link, int type) {
        // Do whatever you need here using the link content and its type
    }
});

TextView with custom fonts

If you need to use a custom font that you previously added in your assets folder, use the FontTextView class

<com.stephenvinouze.linkifiedtextview.FontTextView
            android:id="@+id/custom_font_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="<your_text>"
            app:tvFontName="<your_font_name>.<font_name_extension>"/>

Works also for EditText :

<com.stephenvinouze.linkifiedtextview.FontTEditText
            android:id="@+id/custom_font_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="<your_text>"
            app:tvFontName="<your_font_name>.<font_name_extension>"/>

Note

LinkTextView inherits from FontTextView so you can easily customize your font as well as detecting link using LinkTextView.

License

Copyright 2015 Stephen Vinouze.

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].