Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setOnRemoveLabelListener() is being invoked with position = -1 #13

Open
MarcinOrlowski opened this issue Jan 21, 2016 · 0 comments
Open

Comments

@MarcinOrlowski
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant