Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
Button1.Enabled = False
addstatelist(Button1)
Button2.RequestFocus
addstatelist(Button2)
addstatelist(Button3)
addstatelist(Button4)
addstatelist(Button5)
End Sub
Sub addstatelist(btn As Button)
Dim jo As JavaObject = btn
jo.RunMethod("setFocusableInTouchMode",Array As Object(True))
jo.RunMethod("setFocusable",Array As Object(True))
Dim focused, pressed, selected, disabled, enabled As ColorDrawable
focused.Initialize2(Colors.Gray,5dip, 5dip, Colors.White)
pressed.Initialize2(Colors.DarkGray,5dip, 5dip, Colors.Blue)
selected.Initialize2(Colors.Yellow,5dip, 5dip, Colors.Magenta)
disabled.Initialize2(Colors.DarkGray,5dip, 5dip, Colors.Red)
enabled.Initialize2(Colors.Black, 5dip, 5dip, Colors.Green)
Dim sld As StateListDrawable
sld.Initialize
sld.AddState(sld.State_Focused, focused)
sld.AddState(sld.State_Pressed, pressed)
sld.AddState(sld.State_Selected, selected)
sld.AddState(sld.State_Disabled, disabled)
sld.AddState(sld.State_enabled, enabled)
btn.Background = sld
End Sub
Sub Activity_Resume
Button5.RequestFocus
End Sub