Bubble-Picker icon indicating copy to clipboard operation
Bubble-Picker copied to clipboard

How to Select and deselect any items pragmatically?

Open parmarravi opened this issue 7 years ago • 4 comments

Hello, Thank you for library .Please add some features asap it would be awesome to include this feature in the production app. I have a Feature in which when i select the second item in the bubble view ,the focus of previous item should get deselected . so at a time only one item will get on. If the user presses the second item the focus will get shifted to the next item. Let me know how can i achieve this?

parmarravi avatar Feb 11 '18 18:02 parmarravi

@parmarravi Did you find a way to do this? I need this right now, I tried many things, but since there's only a getter for selectedItems, I tried clearing that list, setting each item's "isSelected" manually to false, but neither worked. @igalata Can you jump in and guide us on how we could do this?

MilanVucic avatar Jun 16 '18 09:06 MilanVucic

You can use below code. But it need to reload view. @parmarravi @MilanVucic @igalata I think set selected should work without using onPause and On Resume but not. ` public void onBubbleSelected(PickerItem pickerItem) {

            if(picker.getSelectedItems().size()>=2)
            {
                picker.onPause();
                lastItem.setSelected(false);
                pickerItem.setSelected(true);
                picker.onResume();
                //onBubbleDeselected(pickerItem);
            }lastItem=pickerItem;
        }`

trbasoglu avatar Jul 23 '18 09:07 trbasoglu

Did you test this? @trbasoglu I think I tried something similar to no avail. setSelected on items that I get from getSelectedItems didn't seem to change much. It would be really cool if this worked. I'll give it a go asap.

MilanVucic avatar Jul 29 '18 13:07 MilanVucic

If you want to go from each bubble to another activity, this one might help https://stackoverflow.com/questions/58460281/link-a-bubble-in-bubble-picker-with-a-button

nurlan-dzhavadov avatar Nov 22 '19 01:11 nurlan-dzhavadov