davidpizarro / autolabelui Goto Github PK
View Code? Open in Web Editor NEWAndroid 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
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
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.
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.
I want to set an id for each label in addition to the text.
There’s no true nesting in Java. Hence, any access to private members of outer class from nested class will have to go via a package scoped method generated by Java to facilitate the call.
To reduce method, make methods of outer class package scoped.
More information:
https://realm.io/news/360andev-jake-wharton-java-hidden-costs-android/
the findViewWithTag(labelToRemove) always return null
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?
My icon cross is to big. can I add a padding to it somehow?
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!.
Is there a way to make the last label in his line to match the remaining width size?
I don't want empty spaces...
I tried to change the AutoViewGroup child size but i cant get it to work..
Is it possible to change the shape? Rounded edges etc...?
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...
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?
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?
onRemoveLabel(View view, int position). position value allway is -1 when i delete a tag. Something went wrong here?
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);
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.
}
});
Seems OnRemoveLabelListener's onRemoveLabel signature is incorrect. Instead of
onRemoveLabel(View view, int position);
it should be rather
onRemoveLabel(Label removedLabel, int position);
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();
}
});
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.