Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
'Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.White
'Label
Dim lbl As Label
lbl.Initialize("lbl")
lbl.TextAlignment = lbl.ALIGNMENT_LEFT
lbl.Text = Text
lbl.Font = Font.CreateNew(16)
'Add label to panel
p.AddView(lbl, 5dip, 2dip, 100%x, Height - 4dip) 'view #0
Return p
End Sub
I'm not sure what else to put in the resize sub because the lines go all the way across the width on rotate, but lines that have lots of text do not resize to take advantage of more width:
B4X:
Private Sub PageHistory_Resize(Width As Int, Height As Int) 'History Page
clv2.SetSize(100%x, 100%y)
End Sub