Getting the View reference for setOnTouchListener
in
Android Processing
•
1 year ago
Hello,
I'm working on a Processing library that responds to touch events on Android.
I've written a class that implements the OnTouchListener and with the onTouch abstract method implemented.
Now I need to set an object of this class to listen to touch events (using the View.setOnTouchListener). However, this method requires a View parameter, which I believe should be the PApplet being "touched". I wonder how can I get the reference of this View parameter that receives touches and will then start passing touch events to my class.
Or if there is another way to do that?
I guess once Processing for Android supports registerMethod("touchEvent", target) this won't be necessary.
Thanks.
Best,
Victor
I'm working on a Processing library that responds to touch events on Android.
I've written a class that implements the OnTouchListener and with the onTouch abstract method implemented.
Now I need to set an object of this class to listen to touch events (using the View.setOnTouchListener). However, this method requires a View parameter, which I believe should be the PApplet being "touched". I wonder how can I get the reference of this View parameter that receives touches and will then start passing touch events to my class.
Or if there is another way to do that?
I guess once Processing for Android supports registerMethod("touchEvent", target) this won't be necessary.
Thanks.
Best,
Victor
1