' Define a color for Enabled state
Dim cdwGreenColorEnabled As ColorDrawable
cdwGreenColorEnabled.Initialize2(Colors.Green, 10dip, 1dip, Colors.Black)
' Define a color for Pessed state
Dim cdwGreenColorPressed As ColorDrawable
cdwGreenColorPressed.Initialize2(Colors.RGB(255,182,18), 10dip, 1dip, Colors.Black)
' Define a StateListDrawable
Dim stdGreenColor As StateListDrawable
stdGreenColor.Initialize
Dim states(2) As Int
states(0) = stdGreenColor.state_enabled
states(1) = -stdGreenColor.state_pressed
stdGreenColor.AddState2(states, cdwGreenColorEnabled)
Dim states(1) As Int
states(0) = stdGreenColor.state_pressed
stdGreenColor.AddState2(states, cdwGreenColorPressed)
' Set stdGreenColor to button background
btnTest.Background = stdGreenColor