Private Sub CreateItem(Width As Int, Title As String, Image As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
Dim height As Int = 250dip
Dim contenth As StringUtils
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 310dip
p.LoadLayout("Card1")
p.SetLayoutAnimated(0, 0, 0, Width,height)
p.SetColorAndBorder(Colors.LightGray,0,Colors.LightGray,0)
pnlCard.Width = Width - 20dip ' <<<<<<<<<<<<<< Klaus's addition
lblContent.TextSize = 15
lblTitle.Text = Title
lblContent.Text = Content
lblContent.Height = contenth.MeasureMultilineTextHeight (lblContent, lblContent.Text)
lblContent.Width = pnlCard.Width - 35dip ' <<<<<<<<<< my dip size <<<< not Klaus's addition
pnlCard.Height = lblContent.Top + lblContent.Height + 5dip ' <<<<<<<<<<<<<< Klaus's addition
p.SetLayoutAnimated(0, 0, 0, Width, pnlCard.Height + 10dip) ' <<<<<<<<<<<<<< Klaus's addition
Return p
End Sub