Giter Site home page Giter Site logo

davidpizarro / autolabelui Goto Github PK

View Code? Open in Web Editor NEW
636.0 636.0 109.0 4.23 MB

Android library to place labels next to another. If there is not enough space for the next label, it will be added in a new line.

License: Apache License 2.0

Java 100.00%

autolabelui's People

Contributors

davidpizarro avatar liaohuqiu avatar porksteak 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

autolabelui's Issues

setOnRemoveLabelListener() is being invoked with position = -1

When I attach setOnRemoveLabelListener(), it is always being invoked with position equals to -1, not the index of label. I see it comes form this code:

    if (listenerOnRemoveLabel != null) {
        if (view.getTag() instanceof Integer) {
            listenerOnRemoveLabel.onRemoveLabel(view, (Integer) view.getTag());
        } else {
            listenerOnRemoveLabel.onRemoveLabel(view, -1);
        }
    }

but addLabel(String label) does sets tag on label as label.setTag(textLabel); so it will not work.

In general the whole concept seem fundamentally broken here, as this position should be obtained dynamically, not from tag, as removing any label is not updating stored position of remaining tags' which will cause troubles when one is i.e. trying to keep labels in sync with something else. For now the only solution seem to be to use labels (strings) and then sync base on this, but it's not efficient.

Adding/Removing items animation disturbs the whole layout.

I have a CollapsingToolbarLayout. In container layout , i have an EditText & a Submit Button. After adding/removing one or two items using AutoLableUI on clicking Submit Button, the whole layout moves towards upward and overlaps the collapsing toolbar layout. Same Issue in another layout, where i am using Toolbar Layout along with some tabs.

getLabel problem

I added this library to gradle in Android studio. When I try to call getLabel or getLabels methods it shows that there are no such methods and in .class file I don't see them.
What can be the reason?

Align center tag content

Hi!
Congratulations for the library, it´s amazing. I would like to ask if there is any way to center horizontal tags, instead of floating them left (align left). Or if you have any clue where I may be working around to get it.

Thank you!.

Label shape

Is it possible to change the shape? Rounded edges etc...?

Can not add to project by gradle

I tried to add this lib to to my project with compile 'com.github.davidpizarro:autolabelui:VERSION' to my gradle file but I receive the message Error:(39, 13) Failed to resolve: com.github.davidpizarro:autolabelui:VERSION

Please help...

setTextColor only takes id resource and sometimes color int

Hi,
I can't set the color in code, Im trying to use android palette and the int color I get won't be set as a color, but sometimes works.
I find out that the setTextColor only takes a resource id and if an exception is thrown then the color int is set.

Could you add a another setColor that takes a color int?

assigning an id to each label

Hi all,
I just want to assign id to each label. I tried mAutoLabel.setId("some_id"); but ((Label) v).getId() is returning -1 for every label.
How can I achieve it?

Add list of labels

For example

List<String> tags = new ArrayList<>();
tags.add("cars");
tags.add("home");
tags.add("people");

AutoLabelUI mAutoLabel = (AutoLabelUI) findViewById(R.id.tags);
mAutoLabel.addLabels(tags);

OnRemoveLabelListener position returnes -1

mAutoLabel.setOnRemoveLabelListener(new AutoLabelUI.OnRemoveLabelListener() {
    @Override
    public void onRemoveLabel(View view, int position) {
        Log.i("Position","Position: " + position); //<---- This always return -1 when clicking the x on the label.
    }
});

Issue when adding more tags

When adding tags and lines are exceeded than 2 then issue occurs, tags are cutting from bottom as attached screen-shot
1

AutoLabel.setOnLabelClickListener is not working

sir,
Method does not override from its super class

error occured while execute this code

mAutoLabel.setOnLabelClickListener(new AutoLabelUI.OnLabelClickListener() {

@Override
public void onClickLabel(Label labelClicked) {
    Snackbar.make(recyclerView, labelClicked.getText(), Snackbar.LENGTH_SHORT).show();
}

});

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.