'B4XMainPage
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Dim ex1 As ExampleForm
ex1.Initialize
B4XPages.AddPageAndCreate("ex1", ex1)
Sleep(0)
B4XPages.ShowPage("ex1")
End Sub
'Example Form
Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private prefdialog As PreferencesDialog
Public AllData As Map
Private pdia As Object
End Sub
Public Sub Initialize As Object
Return Me
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
prefdialog.Initialize(Root, "", 500, 300)
prefdialog.CustomListView1.sv.As(ScrollPane).SetVScrollVisibility("NEVER")
prefdialog.LoadFromJson(File.ReadString(File.DirAssets, "example1.json"))
prefdialog.Dialog.BorderWidth = 0
prefdialog.SeparatorBackgroundColor = xui.Color_Transparent
End Sub
Private Sub B4XPage_Appear
AllData = CreateMap()
pdia = prefdialog.ShowDialog(AllData, "", "")
prefdialog.CustomListView1.sv.ScrollViewInnerPanel.Color = xui.Color_Transparent
For i = 0 To prefdialog.CustomListView1.Size - 1
Dim pnl As B4XView = prefdialog.CustomListView1.GetPanel(i)
For j = 0 To pnl.NumberOfViews - 1
Dim bv As B4XView = pnl.GetView(j)
If bv Is Label Then
If bv.text = "*" Then
bv.Width = 50
bv.TextColor = xui.Color_Red
bv.Text = "Required!"
End If
End If
Next
Next
End Sub
Private Sub B4XPage_CloseRequest As ResumableSub
prefdialog.Dialog.Close(xui.DialogResponse_Positive)
Wait For (pdia) Complete (Result As Int)
Dim isValid As Boolean = True
For Each kw As String In AllData.Keys
Log(kw & TAB & AllData.Get(kw)) 'proceed False, today 1674622800000
Next
If isValid Then
Return True
Else
B4XPage_Appear
Return False
End If
End Sub