3

I am currently trying to implement GestureOverlay to capture both vertical and horizontal strokes on top my view. Typically this functionality is not accepted, as it assumes you are applying on top of a scrollable view.

Using android:orientation I am able to set it to capture one or the other, but I need to know if there is a way to override this to accept both, or if I am stuck using a custom gesture adapter.

Thank You, Josh McKinney

Josh
  • 2,685
  • 6
  • 33
  • 47
  • I have a similar issue, I have restricted the orientation type to portrait and the Gesture Overlay will not recognize gestures that are vertical. (Eg. Drawing the letter "i") The Gesture remains faded. – Navigatron May 07 '11 at 16:26
  • I tried implementing android:orientation="none" into the Gesture Overlay XML file. However this just produces an error saying: _Error: String types not allowed (at 'orientation' with value 'none')_ – Navigatron May 07 '11 at 17:59
  • http://stackoverflow.com/questions/5923079/how-to-set-the-orientation-of-the-views-underneath-the-gesture-overlay-to-none – Navigatron May 07 '11 at 18:18

2 Answers2

0

Which handler you are using with your GestureOverlayView? OnGesturePerformedListener or OnGestureListener? If you are using OnGesturePerformedListener you will be limited to the orientation of your screen. You should use OnGestureListener and implement the onGestureEnded function of it. It gives you the performed gesture regardless of the orientation of your screen:

@Override
    public void onGestureEnded(GestureOverlayView overlay, MotionEvent event) {
        Gesture gesture = overlay.getGesture();
        // Here you can check it against your saved gestures in the gesture library

    }

Cheers Amin

Amin Tavassolian
  • 363
  • 3
  • 10
0

The android:orientation="none" option is part of the Replicant project and isn't valid for standard Android builds. In short, the only options you have are horizontal and vertical, sorry.

Navigatron
  • 2,065
  • 6
  • 32
  • 61