You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:but
addLabel(String label)
does sets tag on label aslabel.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.
The text was updated successfully, but these errors were encountered: