Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private xClv As CustomListView
Private Label1 As B4XView
End Sub
Public Sub Initialize
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage") 'has xClv
Dim l As List = Array(Chr(0xF004), Chr(0xF08A), Chr(0xF005), Chr(0xF006)) 'flled heart, heart, filled star, star
For i =0 To 10
Dim cs As CSBuilder
cs.Initialize.size(50).color(xui.Color_Red).Typeface(Typeface.FONTAWESOME).Append(l.Get(Rnd(0, l.Size))).pop.color(xui.Color_Black).Append(" " ).Append(i).PopAll
xClv.Add(CreateItems(cs), i)
Next
End Sub
Sub CreateItems(c As CSBuilder) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0,0,0, xClv.AsView.Width, 75dip)
p.LoadLayout("item") 'has label1
Label1.Text = c
Return p
End Sub
Private Sub xClv_ItemClick (Index As Int, Value As Object)
Log(Value)
End Sub