├── .classpath
├── .gitignore
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── LICENSE
├── README.md
├── Screenshot_2014-07-23-20-41-05.png
├── Screenshot_2014-07-23-20-41-13.png
├── Screenshot_2014-07-23-20-41-27.png
├── Screenshot_2014-07-23-22-32-27.png
├── Screenshot_2014-07-23-23-06-04.png
├── ic_launcher-web.png
├── libs
└── android-support-v4.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ ├── android.png
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── layout
│ ├── activity_example.xml
│ ├── activity_main.xml
│ ├── hashtag_listview.xml
│ └── tagviewrow.xml
├── menu
│ └── main.xml
├── values-sw600dp
│ └── dimens.xml
├── values-sw720dp-land
│ └── dimens.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
└── src
└── com
└── hashtagandroid
├── HashTagActivity.java
├── ListViewHashTag.java
├── MainActivity.java
├── TagSelectingTextview.java
├── adaptors
└── HashTagAdaptor.java
└── interfaces
└── TagClick.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 |
19 | # Local configuration file (sdk path, etc)
20 | local.properties
21 |
22 | # Proguard folder generated by Eclipse
23 | proguard/
24 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | MainActivity
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
16 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 Ramesh M Nair
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Hash-Tags-Android
2 | =================
3 |
4 | This is a sample of handling hash tags that contain in a text,the tags are clickable and user can do specifc actions for the corresponding hash tags.In this example we can change color and also can give underline to hash tags according to the usecase.
5 |
6 | Hash-Tags: how to use
7 | ------------------------
8 |
9 |
10 | 1. Set Hash Tag Handler
11 |
12 | ```java
13 |
14 | TagSelectingTextview mTagSelectingTextview=new TagSelectingTextview();
15 |
16 |
17 | ```
18 |
19 |
20 |
21 | 2. For setting data form html content
22 |
23 | ```java
24 |
25 | mHashTagTextView = (TextView) findViewById(R.id.hashtag_textview);
26 | mHashTagTextView.setMovementMethod(LinkMovementMethod.getInstance());
27 | mHashTagTextView.setText(mTagSelectingTextview.addClickablePart(
28 | testText, this, mHyperlinkStatus, hashTagColor),
29 | BufferType.SPANNABLE)
30 |
31 | ```
32 |
33 |
34 | 3. For setting data form html content
35 |
36 | ```java
37 |
38 | mHashTagTextView.setText(mTagSelectingTextview.addClickablePart(
39 | Html.fromHtml(testText).toString(), this, mhyperlickStatus, hashtagColor),
40 | BufferType.SPANNABLE);
41 |
42 | ```
43 |
44 |
45 |
46 | ## VIDEO ([SAMPLE](https://www.youtube.com/watch?v=Bp7aiqxKhv0&feature=youtu.be))
47 |
48 |
49 |
50 |
51 |
52 |
53 | ## License
54 |
55 | The MIT License (MIT)
56 |
57 | Copyright (c) 2014 Ramesh M Nair
58 |
59 | Permission is hereby granted, free of charge, to any person obtaining a copy
60 | of this software and associated documentation files (the "Software"), to deal
61 | in the Software without restriction, including without limitation the rights
62 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
63 | copies of the Software, and to permit persons to whom the Software is
64 | furnished to do so, subject to the following conditions:
65 |
66 | The above copyright notice and this permission notice shall be included in all
67 | copies or substantial portions of the Software.
68 |
69 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75 | SOFTWARE.
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/Screenshot_2014-07-23-20-41-05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/Screenshot_2014-07-23-20-41-05.png
--------------------------------------------------------------------------------
/Screenshot_2014-07-23-20-41-13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/Screenshot_2014-07-23-20-41-13.png
--------------------------------------------------------------------------------
/Screenshot_2014-07-23-20-41-27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/Screenshot_2014-07-23-20-41-27.png
--------------------------------------------------------------------------------
/Screenshot_2014-07-23-22-32-27.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/Screenshot_2014-07-23-22-32-27.png
--------------------------------------------------------------------------------
/Screenshot_2014-07-23-23-06-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/Screenshot_2014-07-23-23-06-04.png
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/android.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/res/drawable-hdpi/android.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rameshvoltella/Hash-Tags-Android/64037bb337767cba34036c6d70f8decb68e98c9e/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_example.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
17 |
18 |
26 |
27 |
33 |
34 |
39 |
40 |
47 |
48 |
55 |
56 |
63 |
64 |
71 |
72 | /
73 |
74 |
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
17 |
18 |
23 |
24 |
--------------------------------------------------------------------------------
/res/layout/hashtag_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/layout/tagviewrow.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
18 |
19 |
27 |
28 |
34 |
35 |
44 |
45 |
46 |
53 |
54 |
62 |
63 |
64 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/values-sw720dp-land/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | 128dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | HashTagAndroid
5 | Settings
6 | Hello world!
7 | A hashtag is simply a way for people to search for tweets that have a common topic. For example, if you search on #Gravity (or #gravity or #GraVItY, because it\'s not case-sensitive), youll get a list of tweets related to the movie. What you wont get are tweets that say "Who discovered gravity?" because "gravity" isnt preceded by the hashtag.\n Some Examples #android #google #stackoverflow #fifa #me #world these are all examples of hash tag
8 |
9 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/com/hashtagandroid/HashTagActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Main Page showing hash tag text.
3 | *
4 | * @auther Ramesh M Nair
5 | *
6 | * */
7 |
8 | package com.hashtagandroid;
9 |
10 | import android.app.Activity;
11 | import android.os.Bundle;
12 | import android.text.Html;
13 | import android.text.method.LinkMovementMethod;
14 | import android.view.Menu;
15 | import android.view.View;
16 | import android.view.View.OnClickListener;
17 | import android.widget.CheckBox;
18 | import android.widget.TextView;
19 | import android.widget.TextView.BufferType;
20 | import android.widget.Toast;
21 |
22 | import com.hashtagandroid.interfaces.TagClick;
23 |
24 | public class HashTagActivity extends Activity implements TagClick {
25 |
26 | TextView mHashTagTextView, mHashTagTextViewTwo;
27 |
28 | TagSelectingTextview mTagSelectingTextview;
29 |
30 | String hastTagColorBlue = "#5BCFF2", hastTagColorRed = "#FF0000",
31 | hastTagColorYellow = "#FFFF00", hastTagColorGreen = "#014a01",
32 | testText, currentHashTagColor;
33 |
34 | public static int hashTagHyperLinkEnabled = 1;
35 | public static int hashTagHyperLinkDisabled = 0;
36 | int tempHyperlinkStatus;
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.activity_example);
42 |
43 | mTagSelectingTextview = new TagSelectingTextview();// TagSelectingTextview
44 | // for
45 | // showing tag
46 | // without underline
47 |
48 | mHashTagTextView = (TextView) findViewById(R.id.hashtag_textview);
49 | CheckBox chkIos = (CheckBox) findViewById(R.id.checkBox1);
50 |
51 | testText = getResources().getString(R.string.test_word);
52 |
53 | // testText="