#Region Project Attributes
#ApplicationLabel: CustomListView Experiment
#VersionCode: 1
#VersionName: 1.0.0
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
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
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim clv As CustomListView
Dim p(10) As Panel
Dim Av(10) As AirViewListener
Dim InfoPanel As Panel
Dim ll As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
clv.Initialize(Me, "CustomListView")
Activity.AddView(clv.AsView, 0, 0, 100%x, 100%y)
InfoPanel.Initialize("")
InfoPanel.Color = Colors.White
InfoPanel.Visible = False
ll.Initialize("")
ll.TextColor = Colors.Black
InfoPanel.AddView(ll, 10dip, 10dip, 90dip, 30dip)
Activity.AddView(InfoPanel, 0, 0, 110dip, 50dip)
For i=0 To 9
clv.AddTextItem("Item #" & i, i)
p(i) = clv.GetPanel(i)
Av(i).Initialize(p(i), "AirView")
Next
End Sub
Sub AirView_HoverStart(x As Float, y As Float)
Dim ps As Panel
ps = Sender
Dim l As Label
l = ps.GetView(0)
InfoPanel.Visible = True
ll.Text = l.Text
End Sub
Sub AirView_HoverEnd(x As Float, y As Float)
InfoPanel.Visible = False
End Sub
Sub AirView_HoverMove(x As Float, y As Float)
InfoPanel.Top = y
InfoPanel.Left = x
End Sub