Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private dia As B4XDialog
Private srch As B4XSearchTemplate
Private ime As IME
Private titleBX As B4XView
End Sub
Public Sub Initialize
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
ime.Initialize("")
dia.Initialize(Root)
dia.TitleBarHeight = 0
dia.BlurBackground = False
dia.OverlayColor = xui.Color_Transparent
srch.Initialize
srch.SetItems(Array("AAA", "BBB", "CCC"))
Dim title As Label
title.Initialize("")
titleBX = title
titleBX.SetTextAlignment("CENTER", "CENTER")
titleBX.Color = xui.Color_Blue
titleBX.Font = xui.CreateDefaultBoldFont(20)
titleBX.TextColor = xui.Color_White
titleBX.Text = "This is the Title"
titleBX.Visible = False
Root.AddView(titleBX, 0, 0, Root.Width, 50dip)
End Sub
Private Sub Button1_Click
Dim diaObject As Object = dia.ShowTemplate(srch, "", "", "")
dia.Base.SetLayoutAnimated(0, 0, 50dip, Root.Width, Root.Height - 50dip)
Sleep(25)
ime.HideKeyboard
titleBX.Visible = True
srch.resize(Root.Width, Root.Height - 100dip)
srch.SearchField.mBase.SetLayoutAnimated(0, 0, 0, Root.Width, 80dip)
srch.SearchField.TextField.Width = Root.width
srch.SearchField.lblClear.Left = Root.Width - 60dip
srch.SearchField.lblV.Left = Root.Width - 30dip
Wait For (diaObject) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
Log(srch.SelectedItem)
End If
End Sub