Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private keys As String
Private lblcut As B4XView
Private ETCutA, ETCutB As EditText
Private clv, clvB As CustomListView
Private SD_Keyboard1 As SD_Keyboard
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
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")
keys = "A,B,C,D"
SD_Keyboard1.SpecialKeyFont=xui.CreateMaterialIcons(16)
Dim Ck As CustomKey
Ck.Initialize
Ck.AddRowSimpleChar(Regex.Split(",",keys))
For i = 0 To 7
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 40dip, 40dip)
p.LoadLayout("clvRow")
lblcut.Text = i+1
lblcut.TextColor = xui.Color_Cyan
ETCutA.Text = "A"
SD_Keyboard1.Add(ETCutA,"ETCutA",Ck,Null)
clv.Add(p,i)
Next
For i = 0 To 7
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, 40dip, 40dip)
p.LoadLayout("clvRowB")
lblcut.Text = i+1
lblcut.TextColor = xui.Color_Gray
ETCutB.Text = "B"
SD_Keyboard1.Add(ETCutB,"ETCutB",Ck,Null)
clvB.Add(p,i)
Next
End Sub
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub Button1_Click
xui.MsgboxAsync("Hello world!", "B4X")
End Sub
Private Sub ETCutA_TextChanged (Old As String, New As String)
Dim edtxt As EditText = Sender
If New.Length > 1 Then
Sleep(0)
Dim ttt As String = New.SubString2(New.Length-1,New.Length)
edtxt.Text = ttt
edtxt.SetSelection(1,0)
End If
End Sub
Private Sub ETCutB_TextChanged (Old As String, New As String)
Dim edtxt As EditText = Sender
If New.Length > 1 Then
Sleep(0)
Dim ttt As String = New.SubString2(New.Length-1,New.Length)
edtxt.Text = ttt
edtxt.SetSelection(1,0)
End If
End Sub