Giter VIP home page Giter VIP logo

android-tagview's Introduction

ハローワールド 👋

android-tagview's People

Contributors

kaedea avatar kangod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-tagview's Issues

Gradle repository

Hi,

whether it is possible to make support gradle based projects?

Thanks

ListView中的问题

你好,最近在做标签的功能,使用了你的控件,效果不错,也方便的。在ListView中使用的过程中遇到的问题哈,想请教一下你。
问题描述如下:
在ListView中,我使用了Tagview,在就多Tag的时候,出现了一开始只显示一部分的情况Tag,后面超出的部分Tag处于隐藏状态,通过ListView滑动后才会换行全部显示出来,请问一下这个问题的我哪里设置有问题吗?还是布局的问题?

Making TagView Right To Left

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?

优化问题

TagView 类里面的 这行代码
float tagWidth = tagView.getPaint().measureText(tag.text ) + textPaddingLeft + textPaddingRight;
建议优化一下,tag.text为null的时候判断下。

TagView is not initiated or not display and also get overlap

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.

Set Text Size

suggest using the dimensions in SP, for example tagView.setTextSize(TypedValue.COMPLEX_UNIT_SP , tag.tagTextSize);
instead
tagView.setTextSize(Utils.spToPx(getContext(), tag.tagTextSize));

Does it work correctly when using wrap content?

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?

Disable tag layoutColorPress

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.

不会自动换行的bug解决方案

我在使用时,发现,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));

Performance issues when 50+ Tags in TagView

Observed significant performance issues when:

  • Created a tagview layout inside ScrollView with 50+ tags.
  • Change tag attribute (say color) in OnTagClickListener. Entire view freezes for several seconds.

Performance improvement detected by BlockCanary

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.

Slow tags

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.