Private Sub CreateItem (Width As Int,PubDate As String, Title As String, Content As String) As Panel
Dim p As B4XView = xui.CreatePanel("")
Dim height As Int = 280dip
If GetDeviceLayoutValues.ApproximateScreenSize < 4.5 Then height = 310dip
p.SetLayoutAnimated(0, 0, 0, Width, height)
Dim dummyLabel As Label
dummyLabel.Initialize("")
p.AddView(dummyLabel, 0, 0, Width-30dip, 0)
Activity.AddView(p, 0, 0, Width, Max(height, su.MeasureMultilineTextHeight(dummyLabel, Content)))
p.LoadLayout("Card1")
lblContent.Text = Content
dummyLabel.RemoveView
p.RemoveViewFromParent
lblPubDate.Text = PubDate
lblTitle.Text = Title
Return p
End Sub