Sub CreateListItem(Text As String,ID As String, Width As Int, Height As Int) As Panel
Dim p As Panel
p.Initialize("")
p.Color = Colors.LightGray
'Dim b1,b2,b3 As Button
'b1.Initialize("b1") 'all buttons click events will be handled with Sub Button_Click
Dim lbl As Label
Dim lblID As Label
lblID.Initialize("")
lblID.Text = ID
lblID.Visible = False
lbl.Initialize("")
lbl.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.LEFT)
lbl.Text = Text
lbl.TextSize = 16
lbl.TextColor = Colors.White
p.AddView(lbl, 5dip, 2dip, 150dip, Height - 4dip) 'view #0
p.AddView(lblID, 5dip, 2dip, 150dip, Height - 4dip)
If ResponseID = 0 Then
Dim b1 As Button
b1.Initialize("b1")
b1.Color = Colors.RGB(77, 144, 254)
b1.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
b1.TextColor = Colors.White
b1.Text = "Accept"
p.AddView(b1, 155dip, 2dip, 150dip, 40dip) 'view #1
Else If ResponseID = 1 Then
Dim b2 As Button
b2.Initialize("b2")
b2.Color = Colors.RGB(77, 144, 254)
b2.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
b2.TextColor = Colors.White
b2.Text = "Request Sent"
p.AddView(b2, 155dip, 2dip, 150dip, 40dip) 'view #1
Else If ResponseID = 2 Then
Dim b3 As Button
b3.Initialize("b3")
b3.Color = Colors.RGB(244, 67, 54)
b3.Gravity = Bit.OR(Gravity.CENTER_VERTICAL, Gravity.CENTER_HORIZONTAL)
b3.TextColor = Colors.White
b3.Text = "Remove"
p.AddView(b3, 155dip, 2dip, 150dip, 40dip) 'view #1
End If
'p.AddView(lbl, 5dip, 2dip, 150dip, Height - 4dip) 'view #0
'p.AddView(lblID, 5dip, 2dip, 150dip, Height - 4dip)
'p.AddView(b, 155dip, 2dip, 150dip, 40dip) 'view #1
Return p
End Sub