Sub Activity_Create(FirstTime As Boolean) 'ignore
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("1")
'clv2.Add(CreateListItem($"Item #${i}"$, clv2.AsView.Width, 60dip), $"Item #${i}"$)
Dim ItemWidth As Int = CustomListView1.GetBase.Width
Dim ItemHeight As Int = 50dip
For i = 1 To 11
CustomListView1.Add(CreateItem(i, ItemWidth, ItemHeight), i)
Next
End Sub
Sub Activity_Resume
End Sub
Sub CreateItem(Value As Int, Width As Int, Height As Int) As Panel
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
Select Value
Case 1
p.LoadLayout("layItemSemplice")
Label1.Text = "Item N. " & Value
Case 2
p.SetLayoutAnimated(0, 0, 0, Width, Height+200)
p.LoadLayout("2")
Case 3
p.SetLayoutAnimated(0, 0, 0, Width, Height+20)
p.LoadLayout("3")
Case 4
p.SetLayoutAnimated(0, 0, 0, Width, Height+200)
p.LoadLayout("4")
Case 5
p.SetLayoutAnimated(0, 0, 0, Width, Height+20)
p.LoadLayout("5")
Case 6
p.SetLayoutAnimated(0, 0, 0, Width, Height+200)
p.LoadLayout("6")
Case 7
p.SetLayoutAnimated(0, 0, 0, Width, Height+20)
p.LoadLayout("7")
Case 8
p.SetLayoutAnimated(0, 0, 0, Width, Height+200)
p.LoadLayout("8")
Case 9
p.SetLayoutAnimated(0, 0, 0, Width, Height+20)
p.LoadLayout("9")
Case 10
p.SetLayoutAnimated(0, 0, 0, Width, Height+200)
p.LoadLayout("10")
Case 11
'p.SetLayoutAnimated(0, 0, 0, Width, Height+20)
p.LoadLayout("layItemSemplice")
End Select
Return p
End Sub