Sub Process_Globals
End Sub
Sub Globals
Dim ButtonExample As Button
End Sub
Sub Activity_Create(FirstTime As Boolean)
ButtonExample.Initialize("ButtonExample")
ButtonExample.Typeface = Typeface.DEFAULT_BOLD
ButtonExample.Text = "TEXT COLOR CHANGES :)"
Activity.AddView(ButtonExample, 50%x-150dip, 50%y-100dip, 300dip, 200dip)
SetTextColorList(ButtonExample, Colors.Blue, Colors.Red)
End Sub
Sub SetTextColorList (V As View, DefaultColor As Int, PressedColor As Int)
Dim sd As StateListDrawable
Dim clrs(2) As Int
Dim states(2,1) As Int
clrs(0) = PressedColor
clrs(1) = DefaultColor
states(0, 0) = sd.State_Pressed
Dim r As Reflector
Dim csl As Object
csl = r.CreateObject2("android.content.res.ColorStateList", Array As Object(states, clrs), Array As String("[[I", "[I"))
r.Target = V
r.RunMethod4("setTextColor", Array As Object(csl), Array As String("android.content.res.ColorStateList"))
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub