kaedea / android-tagview Goto Github PK
View Code? Open in Web Editor NEWAn Android TagView Widget. You can edit the tag's style, and set listener of selecting or deleting tag.
An Android TagView Widget. You can edit the tag's style, and set listener of selecting or deleting tag.
ListView里面使用 的时候 ,列表滚动非常卡,频繁的移除和创建view
When I am adding a TAG in the Urdu language. Some of the tags are not visible in TagView
我在使用时,发现,listview加载完之后,tagview不会自动换行,看了一下源码,只需要在tagview下添加以下代码:
public void setMaxWith(int width) {
mWidth = width;
}
并在使用tagview之前,调用此方法,设置一个tagview所占用的最大宽度,例如我的代码中,动态计算出宽度并设置即可:
int phoneWid = HomepageUtil.getPhoneWid();
mHolder.tag_describe.setMaxWith(phoneWid - HomepageUtil.dp2px(15 + 100 + 12 + 15));
TagView
private void drawTags() {
...
View tagLayout = (View) mInflater.inflate(R.layout.tagview_item, null);
...
}
drawTags is called in addTag, which makes it inflate multiple times if we iterator server result to addTag.
Suggestion:
maybe expose a method to call drawTags, instead of call it everytime when add a tag.
What is the best way to change a tag on click? I have at least 50, and when I click on one of them I want to change the tag's color/pressed state. The way I am doing it now is by clearing the tags and then adding them back, but it can be slow. Any suggestions?
I have added tagview to my recyclerview's footer. I am facing issue like, when I scroll to down. initially tags that is in the footer is not going to display. But then I scroll a little bit to up direction and again come back to footer, it show me the tags. I dont know where is the issue.
I am adding tags as mention below:
for(int i = 0; i < mStory.getTags().size(); i++) {
footerHolder.tagView.removeAllTags();
Tag tag = new Tag(mStory.getTags().get(i).getName());
tag.layoutBorderSize = 2f;
tag.layoutBorderColor = ContextCompat.getColor(mContext
, R.color.my_theme_primary);
tag.tagTextColor = ContextCompat.getColor(mContext
, R.color.my_theme_primary_text);
tag.background = ContextCompat.getDrawable(mContext,R.drawable.bg_tag);
footerHolder.tagView.addTag(tag);
}
footerHolder.tagView.setOnTagClickListener(new OnTagClickListener() {
@Override
public void onTagClick(Tag tag, int position) {
Toast.makeText(mContext, "position=" + position,
Toast.LENGTH_SHORT).show();
}
});
My code is proper in footer because other view that I have mention in footer looks fine with even initial scrolling. But Tags is not getting displayed when scroll initial.
Please share solution to that with me.
你好,最近在做标签的功能,使用了你的控件,效果不错,也方便的。在ListView中使用的过程中遇到的问题哈,想请教一下你。
问题描述如下:
在ListView中,我使用了Tagview,在就多Tag的时候,出现了一开始只显示一部分的情况Tag,后面超出的部分Tag处于隐藏状态,通过ListView滑动后才会换行全部显示出来,请问一下这个问题的我哪里设置有问题吗?还是布局的问题?
Hi,
whether it is possible to make support gradle based projects?
Thanks
i want use tagview int Listview item,but it doesn't work,can you give me some smaples?
it would be good if there will be implemented builder pattern for customizing Tag (not TagView) , or maybe why not both .
TagView 类里面的 这行代码
float tagWidth = tagView.getPaint().measureText(tag.text ) + textPaddingLeft + textPaddingRight;
建议优化一下,tag.text为null的时候判断下。
Hi,Tnx for your great work Kaedea.
I'm going to make TagView right to left since in my country Iran the language (Persian) is right to left.
I mean I need the tags to be set from right and another tag that will be added later set to left of it.
How can I do that?
Can you develop the code and add this option to it please?
where is your compile "librarynameString" thing?
This library offers all other necessary features but i badly in need of this to change color of a selected tag ,so that user can get visual feedback which tag was selected
suggest using the dimensions in SP, for example tagView.setTextSize(TypedValue.COMPLEX_UNIT_SP , tag.tagTextSize);
instead
tagView.setTextSize(Utils.spToPx(getContext(), tag.tagTextSize));
How do I arrange all the tags horizontally and scroll them horizontally from left to right.
Observed significant performance issues when:
OnTagClickListener
. Entire view freezes for several seconds.Is there a way to disable the layout color press event on a tag?
The purpose is to not change any thing on the tag layout, when the user clicks it. The tag should remain unchanged.
I have tried to resize it dinamically. Used wrap_content and it seems that it occupies the space because the editext next to it shrinks. But no tag is draw. Do you have a workaround for these?
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.