I am having trouble trying to use Gesture Detector with views created in an array.
Sender doesn't appear to work with Gesture Detector. I need to be able to detect swipes, clicks, drags, and long presses and know which panel was touched.
Any suggestions appreciated
B4X:
Sub Process_Globals
Dim GD As GestureDetector
End Sub
Sub Globals
Dim p(20) As Panel
End Sub
Sub Activity_Create(FirstTime As Boolean)
For i=1 To 20
p(i).Initialize("p")
Activity.AddView(p(i), 0, (i-1)*85dip, 100%x, 70dip)
p(i).Tag = i
GD.SetOnGestureListener(p(i), "Gesture")
Next
End Sub
Sub Gesture_onTouch(Action As Int, X As Float, Y As Float, MotionEvent As Object)
Dim pnl As Panel
pnl = Sender
p(pnl.Tag).Color = Colors.Green
End Sub
Sender doesn't appear to work with Gesture Detector. I need to be able to detect swipes, clicks, drags, and long presses and know which panel was touched.
Any suggestions appreciated