Share My Creation B4A Checkbox List Pop-up UI Class

hello,
today i made a class to pop up a list selection with checkboxes (in a scrollview) from a key value map inside a activity.
after ok click the map is updated.

note: i think a better solution is using a extra activity and jump into with CallSubDelay2 and then jump back where it comes from also with CallSubDelay2 + Activity.Finish

trigger in activity via button click
B4X:
Sub SelectListe_Click
 
    Log("SelectListe_Click Start")
 
    Dim Tool As MyTools
    Tool.Initialize
 
    Dim m As Map = CreateMap("Car": False, "Truck": False,"Train":False,"Airplane":True)
 
    Wait For(Tool.Dialog(Activity,m,"Select ..")) Complete (Result As Boolean)
 
    For Each Key As String In m.Keys
        If m.Get(Key)=True Then
            Log("+ " & Key)
        Else
            Log("- " & Key)
        End If
    Next

    Log("SelectListe_Click End")
 
End Sub

screenshot from phone
Screenshot_2018-03-21-22-14-59.png
 

Attachments

  • selectlist.bal
    2.6 KB · Views: 577
  • MyTools.bas
    1.9 KB · Views: 592
Last edited:
Top