#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: CustomListView Example
#VersionCode: 1
#CanInstallToExternalStorage: False
#End Region
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
Private clv2 As CustomListView
Dim IME As IME
Private lblEvent As Label
Private lblTime As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
IME.Initialize("IME")
lblEvent.Initialize("lblEvent")
IME.AddHandleActionEvent(lblEvent)
For i = 1 To 10
clv2.Add(CreateListItem($"Item #${i}"$, clv2.AsView.Width, 70dip), 70dip, $"Item #${i}"$)
Next
End Sub
Sub IME_HandleAction As Boolean
Dim e As EditText
e = Sender
Log("Text: " & e)
End Sub
Sub clv2_ItemClick(Index As Int, Value As Object)
IME.ShowKeyboard(lblEvent)
Log(Index & " = " & Value)
End Sub
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
'we need to add the panel to a parent to set its dimensions. It will be removed after the layout is loaded.
Activity.AddView(p, 0, 0, Width, Height)
p.LoadLayout("CellItem")
p.RemoveView
'lblTime will point to the last added views.
lblTime.Text = Text
Return p
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub