Sub CreateItem(clr As Int, Title As String, id As ItemData) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, clv1.AsView.Width, id.ExpandedHeight)
p.LoadLayout("Item")
p.SetLayoutAnimated(0, 0, 0, p.Width,id.CollapsedHeight)
lblTitle.Text = Title
lblTitle.TextSize = 20
lblTitle.Height = id.CollapsedHeight *.6
If clv1.Size = 0 Then
lblInfo.Text = ""
End If
lblInfo.Top = id.CollapsedHeight *.6
lblInfo.Height = id.CollapsedHeight * .3
pnlTitle.Color = Colors.DarkGray
lblInfo.Color = Colors.DarkGray
pnlExpanded.Color = ShadeColor(clr)
p.Tag = False 'collapsed
Return p
End Sub