#Region Project Attributes
#ApplicationLabel: CustomListView
#VersionCode: 1
#VersionName:
'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.
Dim xui As XUI
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.
Private CLV1 As CustomListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
CLV1.DefaultTextBackgroundColor=Colors.Gray
For i = 0 To 10
CLV1.Add(createItem("Item #" & i,CLV1.AsView.Width,40dip),i)
Next
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
private Sub createItem(Text As String,width As Int,height As Int) As B4XView
Dim p As B4XView=xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0,100%x,10%x)
p.Color=Colors.White
Dim lbl As Label
lbl.Initialize("")
lbl.Text=Text
lbl.TextColor=Colors.Black
p.AddView(lbl,0,0,4dip,5dip)
Return p
End Sub