I have a button setup to change from black to red when I touch and release, or when I touch and move my finger off it. You can clearly see the color go from black to red twice, and logging the events confirms it. Touching the button causes down, up, down, up and click events. I was expecting to see simply: down, up and click. I'm must admit I'm a bit embarrassed to be asking such basic questions about buttons at this point, but what am I missing? Thanks!
B4X:
Sub Globals
Dim button1 As Button
Dim eventCounter As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.Color=Colors.LightGray
button1.Initialize("button1")
button1.Color=Colors.Black
activity.AddView(button1,50dip,50dip,100dip,100dip)
button1.Text="TEST"
button1.TextColor=Colors.White
eventCounter=0
End Sub
Sub button1_down
button1.Color=Colors.Red
Log("down")
End Sub
Sub button1_up
button1.color=Colors.Black
Log("up")
End Sub
Sub button1_click
button1.color=Colors.Black
Log("click")
eventCounter=eventCounter+1
Log("event: "&eventCounter)
End Sub