Bubble-Picker
Bubble-Picker copied to clipboard
How to Select and deselect any items pragmatically?
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 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?
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;
}`
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.
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