Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid: how to detect horizontal and vertical gesture lines
    text
    copied!<p>I have some objects which I want to connect with lines. The user should be able to do so with a simple line-gesture. I use a GestureOverlayView and read that article <a href="http://developer.android.com/resources/articles/gestures.html" rel="nofollow">http://developer.android.com/resources/articles/gestures.html</a>, which says the following</p> <blockquote> <p>orientation: indicates the scroll orientation of the views underneath. In this case the list scrolls vertically, which means that any horizontal gestures (like action_delete) can immediately be recognized as a gesture. Gestures that start with a vertical stroke must contain at least one horizontal component to be recognized. In other words, a simple vertical line cannot be recognized as a gesture since it would conflict with the list's scrolling.</p> </blockquote> <p>And that is my problem - I want to draw the lines horizontal and vertical</p> <p>Now I have a OnGesturePerfomedListener, which does the normal gesture recognition and additionally a GestureOverlayView.OnGestureListener, in which I detect the lines. But now I want to draw a dashed line - also vertical and horizontal. It would be so much easier, if I could get the complete gesture as in the OnGesturePerformedListener, instead of every single stroke of the dashed line, as in the onGestureListener.</p> <p>Any ideas how I can solve this easily ? Is there a method, which is called when the gesturing is done, even if it is not recognised ? I also tried to use the GestureDetector.OnGestureListener, which I now use to detect longPress, but it won't help with that problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload