Sub Panel1_Touch (Action As Int, X As Float, Y As Float) As Boolean 'Return True to consume the event
Select Action
Case Activity.ACTION_DOWN
StartX = X
Case Activity.ACTION_UP
If Abs(X - StartX) > MOVEMENT_THRESHOLD Then
Swipe(X < StartX)
End If
End Select
Return True
End Sub
Sub Swipe(Left As Boolean)
If Left Then Msgbox("Left", "") Else Msgbox("Right", "")
End Sub