In my iOS app, which I'm porting to Android/B4X, I have a custom list view, containing panels of filter options. Each one has a text view and a switch. I can easily reset all filters to the default with this code:
Unfortunately, there doesn't seem to be an easy way to do the same with B4XSwitch. How can I reset the values (and, for filtering, check which ones have been set to which value)?
One alternative for the latter would be to have an array of values, updating when a switch is changed, but that still doesn't solve the reset issues; I could, I guess, just rebuild all the panels, but that seems a bit extravagant.
B4X:
For i = 0 To userFilter.GetSize -1
Dim p As Panel = userFilter.GetPanel(i)
Dim s As Switch = p.GetView(0)
s.value = false
Unfortunately, there doesn't seem to be an easy way to do the same with B4XSwitch. How can I reset the values (and, for filtering, check which ones have been set to which value)?
One alternative for the latter would be to have an array of values, updating when a switch is changed, but that still doesn't solve the reset issues; I could, I guess, just rebuild all the panels, but that seems a bit extravagant.