Sub Class_Globals
Private Root As B4XView 'ignore
Private xui As XUI 'ignore
Private clv1 As CustomListView
Private dd As DDD
End Sub
Private Sub B4XPage_Created (Root1 As B4XView)
dd.Initialize
xui.RegisterDesignerClass(dd)
Root = Root1
Root.LoadLayout("layCLV")
clv1.Add(CreateListItem("Menu Item 1", clv1.AsView.Width, 60dip,"menuitem.png"),"Menu Item 1")
End Sub
Private Sub CreateListItem(Text As String, Width As Int, Height As Int, Icon As String) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
p.LoadLayout("layMainMenu")
dd.GetViewByName(p, "ImageView1").setBitmap(LoadBitmap(File.DirAssets ,Icon ))
dd.GetViewByName(p, "Label1").Text = Text
Return p
End Sub