Sub CreateItem(clr As Int, LineNo As Int, Title As String, ExpandedHeight As Int) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, lstProdCart.AsView.Width, ExpandedHeight)
p.LoadLayout("CartList")
p.SetLayoutAnimated(0, 0, 0, p.Width, p.GetView(0).Height) 'resize it to the collapsed height
' Cart Width Is 30%, So All Width Based On It ...
pnlProdList.Width = 30%x
pnlProdDet.Width = 30%x
' Can't Manage To Set Width Of The Panels. So Reduce It To 30% Calculation
lblRowNo.Width = 4%x
lblProdName.Width = 12%x
lblQnty.Width = 5%x
lblWght.Width = 4%x
lblDropArrow.Width = 5%x
lblLess.Left = 30dip
lblAdd.Left = lblLess.Width + 30dip
lblDelete.Left = lblLess.Width + lblAdd.Width + 30dip
lblRowNo.Left = 0
lblProdName.Left = lblRowNo.Width
lblQnty.Left = lblRowNo.Width+lblProdName.Width
lblWght.Left = lblRowNo.Width+lblProdName.Width+lblQnty.Width
lblDropArrow.Left = lblRowNo.Width+lblProdName.Width+lblQnty.Width+lblWght.Width
lblRowNo.Text = LineNo
lblProdName.Text = Title
lblQnty.Text = LineNo
lblWght.Text = "Pcs"
pnlProdList.Color = clr
pnlProdDet.Color = ShadeColor(clr)
Return p
End Sub