• Home
Name Date Size #Lines LOC

..--

.google/03-May-2024-2418

Application/03-May-2024-1,428527

gradle/wrapper/03-May-2024-66

screenshots/03-May-2024-

CONTRIB.mdD03-May-20241.6 KiB3627

CONTRIBUTING.mdD03-May-20241.5 KiB3627

LICENSED03-May-202411.1 KiB204170

README.mdD03-May-20243.1 KiB8158

build.gradleD03-May-202410 110

gradlewD03-May-20245 KiB165122

gradlew.batD03-May-20242.3 KiB9166

packaging.yamlD03-May-2024481 1610

settings.gradleD03-May-202422 21

README.md

1
2Android TextLinkify Sample
3===================================
4
5This sample illustrates how links can be added to a TextView. This can be done either
6automatically by setting the "autoLink" property or explicitly.
7
8Introduction
9------------
10
11This sample demonstrates how clickable links can be added to a `TextView` in Android.
12
13This can be done in three ways:
14
15- **Automatically:** Text added to a TextView can automatically be linkified by enabling
16autoLinking. In XML, use the `android:autoLink` property, programatically call
17[android.widget.TextView#setAutoLinkMask(int)][1] using an option from
18[android.text.util.Linkify][2].
19- **Parsing a String as HTML:** See [android.text.Html#fromHtml(String)][3].
20- **Manually by constructing a [android.text.SpannableString][4]:** Consisting of
21[android.text.style.StyleSpan][5] and [android.text.style.URLSpan][6] objects that
22are contained within a [android.text.SpannableString][7].
23
24[1]: http://developer.android.com/reference/android/widget/TextView.html#setAutoLinkMask(int)
25[2]: http://developer.android.com/reference/android/text/util/Linkify.html
26[3]: http://developer.android.com/reference/android/text/Html.html#fromHtml(java.lang.String)
27[4]: http://developer.android.com/reference/android/text/SpannableString.html
28[5]: http://developer.android.com/reference/android/text/style/StyleSpan.html
29[6]: http://developer.android.com/reference/android/text/style/URLSpan.html
30[7]: http://developer.android.com/reference/android/text/SpannableString.html
31
32Pre-requisites
33--------------
34
35- Android SDK 27
36- Android Build Tools v27.0.2
37- Android Support Repository
38
39Screenshots
40-------------
41
42<img src="screenshots/main.png" height="400" alt="Screenshot"/>
43
44Getting Started
45---------------
46
47This sample uses the Gradle build system. To build this project, use the
48"gradlew build" command or use "Import Project" in Android Studio.
49
50Support
51-------
52
53- Google+ Community: https://plus.google.com/communities/105153134372062985968
54- Stack Overflow: http://stackoverflow.com/questions/tagged/android
55
56If you've found an error in this sample, please file an issue:
57https://github.com/googlesamples/android-TextLinkify
58
59Patches are encouraged, and may be submitted by forking this project and
60submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
61
62License
63-------
64
65Copyright 2017 The Android Open Source Project, Inc.
66
67Licensed to the Apache Software Foundation (ASF) under one or more contributor
68license agreements.  See the NOTICE file distributed with this work for
69additional information regarding copyright ownership.  The ASF licenses this
70file to you under the Apache License, Version 2.0 (the "License"); you may not
71use this file except in compliance with the License.  You may obtain a copy of
72the License at
73
74http://www.apache.org/licenses/LICENSE-2.0
75
76Unless required by applicable law or agreed to in writing, software
77distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
78WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
79License for the specific language governing permissions and limitations under
80the License.
81