Sub CreateListItem(IdentityNo As String, Film As String, Genre As String, Year As String, Width As Int, Height As Int, Counter As Int) As Panel
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
Dim MyView As HorizontalScrollView
MyView.Initialize(Width, "myview")
MyView.Panel.LoadLayout("ItemSelectItems")
MyView.Panel.Width = 300%x
Label1.Text = IdentityNo
Label1.TextColor = Colors.Black
Label2.Text = Film
Label2.TextColor = Colors.Black
Label3.Text = Genre
Label4.Text = Year
p.AddView(MyView, 0, 0, Width, Height)
If Film = "Enchanted" Then
p.Color = Colors.Red
Else
If Counter Mod 2 = 0 Then
p.Color = Colors.White
Else
p.Color = Colors.LightGray
End If
End If
Return p
End Sub