Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
words = Array("aaa", "bbb", "ccc", "ddd", "eee", "fff")
NumberOfRealItems = words.Size
CustomListViews = Array As CustomListView(CustomListView1, CustomListView2,CustomListView3)
For j=0 To sectionCount-1
PCLVs(j).Initialize(Me, "PCLV", CustomListViews(j))
PCLVs(j).ShowScrollBar = False
For i = 0 To 500
PCLVs(j).AddItem(49%x, xui.Color_White, words.Get(i Mod NumberOfRealItems))
Next
PCLVs(j).Commit
End Sub
Sub clvx_VisibleRangeChanged (FirstIndex As Int, LastIndex As Int) 'clvx is event name of all 3 xCLV
Dim clv As CustomListView=Sender
Dim j As Int=clv.GetBase.Tag
For Each i As Int In PCLVs(j).VisibleRangeChanged(FirstIndex, LastIndex)
Dim item As CLVItem = clv.GetRawListItem(i)
Dim pnl As B4XView = xui.CreatePanel("")
item.Panel.AddView(pnl, 0, 0, item.Panel.Width, item.Panel.Height)
pnl.LoadLayout("Item")
Label1.Text = item.Value
Next
End Sub
Sub clvx_ItemClick (Index As Int, Value As Object)
Log(Index & ", " & Value)
End Sub