'Set the style of a button
'chosen=True: style2 when button is chosen。 || chosen=False: style1 when button is not chosen
private Sub SetButtonStyle(button As B4XView, chosen As Boolean)
Private sld As StateListDrawable
Private cd1,cd2 As ColorDrawable
cd1.Initialize2(Colors.Gray,0,0,Colors.Transparent) 'style1
cd2.Initialize2(Colors.White,0,1dip,Colors.Black) 'style2
If chosen=True Then
sld.Initialize
sld.AddState(sld.State_Enabled,cd2)
button.As(Button).Background=sld
Else
sld.Initialize
sld.AddState(sld.State_Enabled,cd1)
button.As(Button).Background=sld
End If
End Sub