cutta / tagview Goto Github PK
View Code? Open in Web Editor NEWAndroid TagView-HashTagView
License: Apache License 2.0
Android TagView-HashTagView
License: Apache License 2.0
In class TagView in method addTags(List<Tag> tags)
you do addTag(item)
;
But what are doing here?
public void addTag(Tag tag) {
mTags.add(tag);
drawTags();
}
After adding of each tag to addTag you draw tags...
Inside drawTags()
first
removeAllViews();
and then
for (Tag item : mTags)
Are you jokking? Why if you are going to remove and redraw all, you do it after adding of each element to inner list?
Sorry guys but it have to be optimized!
Hello,
Could you please add an optional string property to the Tag object, called "uniqueID" or something like that, so I can use this to tell the difference between two tags with the same text (users with the same display name)?
Thanks!
If you set the background color of the TagView the tags are not drawn properly and it shows completely blank. The tags are there, because the TagView is using the correct space, but they are just not drawn correctly.
Here is the XML:
<com.cunoraz.tagview.TagView
xmlns:tagview="http://schemas.android.com/apk/res-auto"
android:id="@+id/tagsDanceStyles"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ProfileEditPaddings"
tagview:lineMargin="5dp"
tagview:tagMargin="5dp"
tagview:textPaddingLeft="8dp"
tagview:textPaddingTop="5dp"
tagview:textPaddingRight="8dp"
tagview:textPaddingBottom="5dp" />
<com.cunoraz.tagview.TagView
xmlns:tagview="http://schemas.android.com/apk/res-auto"
android:id="@+id/tagsDanceStylesEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ProfileEditPaddings"
android:background="@color/red_500"
tagview:lineMargin="5dp"
tagview:tagMargin="5dp"
tagview:textPaddingLeft="8dp"
tagview:textPaddingTop="5dp"
tagview:textPaddingRight="8dp"
tagview:textPaddingBottom="5dp" />
Here is how I fill both Tag Views:
for (DanceStyle style : DanceStyles.all()) {
Tag tag = new Tag(style.name);
//tag.tagTextColor = getResources().getColor(R.color.editHeaderText);
tag.layoutColor = getResources().getColor(style.resColor);
tag.radius = 20f;
danceStyles.addTag(tag);
danceStylesEdit.addTag(tag);
}
And this is the result:
You can see that despite both Tag Views being filled exactly the same way, the one with the background property set draws no tags... Maybe the tags are "bellow" the background...
nt.
See no need of creation additional local variable targetTag
.
deletableView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mDeleteListener != null) {
Tag targetTag = tag;
mDeleteListener.onTagDeleted(TagView.this, targetTag, position);
}
}
});
I don't know why and why there are no such effect on example, but In my test of view, even I do as your app but from empty project I have infinity recursion
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
drawTags();
}
run drawTags();
which run removeAllViews();
which run invalidate(true);
which run onDraw
and again again again
Hi guys, I'm trying to add Tag on a TagView. I know how to do that, I have a particular problem : I'm trying to add Tags dynamically to a TagView but when I do that it doesn't display any tags. I'm debugging and print some Logs in order to know if inside the TagView there are any tags. I know for sure there are, so the problem isn't the Tags themself, I think there is a problem with XML. I've another TagView and with them I've noticed that if I add a backgroud to a TagView ( in order to get a line to the bottom of the View ) the widget doesn't display any Tags.
So the problem is : what's the problem with my XML?
`
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:text="Interessi:"
android:textSize="18sp"
android:paddingRight="7dp"
android:id="@+id/textView4" />
<com.cunoraz.tagview.TagView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/modify_interests"
/>
</LinearLayout>
`
Hi,
I am just getting on board with the library. Would like to know if there is any way to drag and drop tags from one TagView to another. My use case is to create a tag filter using the tags from the tag view.
Thanks,
Prasanna
All the rows of tags that are created are left aligned. There should be an option so that the tag rows are centered as they look superb.
Tag rows are center justify.
setBackgroundDrawable() have to be removed to do not get problem with new android api
I'm trying to change colour of the tag if the tag is clicked.
I'm doing this is onTagClickListener, code can be found below:
private OnTagClickListener onTagClickListener = new OnTagClickListener() {
@OverRide
public void onTagClick(Tag tag, int i) {
tag.tagTextColor = getContext().getColor(R.color.black);
}
};
Is it possible to change colour of the tag this way?
Also, I need to change colour of the tag depending on the present colour of the tag. Is it possible to do using this library?
Thanks.
All the rows of tags that are created are left aligned. There should be an option so that the tag rows are centered as they look neat.
I want to remove all views of tagview, but mTags doesn't clear.So I add a removeAllTags method.
I would love to see the gradle settings to include this into your app in the README.md as well as the methods count as this plays a huge role in modern android development.
If you want me to I can create a pull-request.
Here are the Infos:
repositories {
maven {
url "https://jitpack.io"
}
}
dependencies {
compile 'com.github.Cutta:TagView:c15dd8288a'
}
Taken from Android-Arsenal
The badge indicating the methods-count.
Taken from methodscount.com
Hello there;
I want to show a text consisting of two lines within a label. \ n or html text does not work.
Best regards.
When used in recycle view, addTags can not be updated. Do not calculate screen length. It is vertical alignment.
You can not do notifyDataSetChanged because addTags in adapter.
What should I do?
when 1st time Tagview is call it don't show the tags in proper format .single tag shown in single line at 1st call, after 1st call it will work correct
If we have a long text then three dots are shown but not the delete icon.
I use setVisibility(GONE) for TagView's parent view in Activity's onCreate method, and when I show the view again, tagview can not draw tags then. I had a look at tagview code, and found it maybe caused by
boolean variable mInitialized.
Can you please have a look at this? Thanks very much.
how to add Emojis to Tags... Is it possible????
set tagView line find problem, measure line have mistaken,please modify
The sample app dropbox url in the readme.md file is incorrect.
Is actually pointing to a demo app of GifView.
After onDelete the item is still in inner collection, and it can break business logic.
deletableView.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mDeleteListener != null) {
Tag targetTag = tag;
mDeleteListener.onTagDeleted(TagView.this, targetTag, position);
}
}
});
Need delete from inner mTags!
If i add the first tag which is the header tag in your lib, and if its width is greater than device width, then the tags are not getting displayed in the view, or they are not getting added in the tag group.
And also after the header tag being larger than the screen, if i add other small letters tags then, they are also not getting added and displayed.
i tried to hide relativelayout initially and then show layout on checkbox checked listener.
On very first time the tag view arrangements are in vertical.
While clicking on it again is showing in horizontal arrangement.
Why items orientation is changed on first time ? https://gist.github.com/engr-erum/0f2e257388aa09c95f5b7afdd64c3236 @Cutta @bryant1410 @NikoYuwono @m-ezzat
My dependecies are as follows, however, when using the TagView, I keep getting a java.lang.NoClassDefFoundError: android.support.v7.widget.TintManager. I am using a
compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' compile 'com.android.support:support-v4:23.1.1'
I am using a build version of "23.0.2" and I do have jitpack installed in the correct location as shown
allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } }
I did everything possible but its showing the message.
Failed to resolve: com.github.Cutta:TagView:c15dd8288a
Show in File
Show in Project Structure dialog
I have a bug.
first. i add 4 Tag in A Fragment. and then i start to B Fragment to update Tag . A fragment also need to update sync. and i Transfer a List to A fragment with EventBus.
in A Fragment , once i get Event , i call TagView.removeall(),then add new Tag. but the 4 previous Tag is still visible.
but my Log tell me, after removeAll , the TagView.getChildCount() is 0. so it should be removeall.
tagView.removeAll();
Logger.e(TAG,"tagView.getChildCount() = "+tagView.getChildCount());
Can you help me ?
it should be textPaddingBottom
. Same thing with getter and setter.
In current readme.md, The xml tag for TagView is
<cuneyt.example.com.tagview.Tag.TagView
Which is not found in classpath, such giving exception.
Replacing above line with <com.cunoraz.tagview.TagView
works and gives no exception. Please update documentation reflecting this change.
I am using a tagview and adding tags dynamically. But I can't find the 'x' aka delete button on the tag.
Hi,
There is a problem to add two different TagView in the same layout?
when i try to do this is i get a error..
Theme: themes:{default=overlay:com.cyngn.hexo, iconPack:com.cyngn.hexo, fontPkg:com.cyngn.hexo, com.android.systemui=overlay:com.cyngn.hexo, com.android.systemui.navbar=overlay:com.cyngn.hexo}
android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class android.support.design.internal.NavigationMenuItemView
The code i used is
<com.cunoraz.tagview.TagView android:id="@+id/tag_group" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="10dp" />
and when i duplicate this (and change the id name..) i get the error.
Thanks,
Meni.
@Cutta Can u see about this? This will be very much useful to me. Thank you
As like in https://github.com/jjhesk/TagViewLayout library
Although it's fine for the example, I think the big country list json string should not be in the library.
how to change background colors in your library?
I debugged your library and found out that if i add a tag with 90 width in total and then after that tag has been added in the tag view, i am adding one more tag of 40 width. If on adding i will add the tags in ascending order width list like 10 width then 15 then 30 etc... so there will be no issues regarding this, but if that is not the case then the tags are not getting displayed fully. Please fix this immediately.
Not able to change the text style in tagview. I need to make text bold and italic. If there is any option available, do tell me.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.