Is it possible to create custom view that both overrides function onTouch()
inside this custom view implementation, and enables to set custom GestureDetector via setOnTouchListener()
.
- I would like to Override onTouch() method to implement some drawing logic in the View related to touch gestures.
- Than I would like to use such self-contained custom view to attach to it GestureDetector to detect and handle some custom gestures on this view inside Activity.
It works for me only if I have onTouch() drawing implementation, or only setOnTouchListener() to detect gestures. Maybe I could place this gesture detection inside view. But I would prefer to have this as separate loosely coupled reusable component rather than tightly coupled gesture detector.
You can do somethink like this: