0

I have a view (let's say an imagebutton) centered inside a RelativeLayout. I am able to detect a fling for the imagebutton using GestureDetector only if the touch starts inside the imagebutton. How to detect a fling that starts outside the imagebutton, intercepts it and end also outside?

Thanks for help.

DeliriumTremens
  • 340
  • 5
  • 14
  • what if you process the gesture in the layout and see if it collides with such or such view? – eduyayo Nov 27 '14 at 17:24
  • Yes, it's a possible solution. Something quicker? :) – DeliriumTremens Nov 27 '14 at 22:03
  • C this http://stackoverflow.com/questions/12980156/detect-touch-event-on-a-view-when-dragged-over-from-other-view looks like a very aimilar problen though not exactly but they describe 4 alternatives – eduyayo Nov 27 '14 at 22:55
  • Hmm Luis's way seems viable, I'll try it tomorrow. Thank u a lot to pointing me at it. – DeliriumTremens Nov 28 '14 at 00:44
  • Worked like a charm, with some tweaks: I used the GestureDetector to check for fling in the insideView and it needs also ACTION_DOWN and ACTION_UP events, while it receives obviously only ACTION_MOVE from the container. So the first interacting event's action has to be dispatched as ACTION_DOWN and once the user interacts with the inner view you also has to dispatch every event until ACTION_UP regardless they are inside or outside inner view bounds. Thanks! – DeliriumTremens Nov 28 '14 at 11:16
  • So... Vote me up! ^g^ – eduyayo Nov 28 '14 at 20:05
  • Cannot vote a comment! :) Issue a reply – DeliriumTremens Dec 02 '14 at 19:02
  • Dqmn. Remember me when u reach the quote!! ^^ – eduyayo Dec 02 '14 at 21:27

0 Answers0