Question

I detect swipe gesture on 2 views with different methods: first is via GestureDetector, and the second is GestureOverlayView (I need this because the 2nd view is the GridView and GestureDetector does not work properly on this).

The first is almost instant, but the second has delay about 1 second (Nexus S, ICS). Why, and how can I fix it?

I can not change the method, because I'll need to recognize more complicated gestures later, but I want it to work instantly.

Was it helpful?

Solution

I found the solution:

android:fadeOffset="0"
android:fadeDuration="0"

And it works instantly :)

OTHER TIPS

Because of its nature GestureOverlayView relies on timings before it starts recognizing a shape. It's not a matter of performance.

EDIT

Sorry, but i do not think it is possible to change the reaction time of the GestureOverlayView :(

EDIT-END

If you don't have the GestureOverlayView set in the xml but directly in the code you can use the following which do the same as RankoR solution :

mGestureOverlayView.setFadeEnabled(false);
mGestureOverlayView.setFadeOffset(0);

The method onGesturePerformed is then called instantly after onGesturingEnded (8 ms after in my case)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top