package br.odb.angstronme;

/**
 * Created by monty on 6/6/15.
 */
public class SimpleGestureDetector {

    public Vec2 acc = new Vec2(0, 0);
    public Vec2 touch = new Vec2(0, 0);

    public boolean isHorizontal() {
        float ax = Math.abs(acc.x);
        float ay = Math.abs(acc.y);

        return (ax > ay);
    }

    public void reset() {
        acc.x = 0;
        acc.y = 0;
    }
}

@@ -98,16 +98,74 @@
 ctor %7B%0A%0A
+    public static final float TRIVIALITY_THRESHOLD = 50;%0A%0A
     publ
@@ -446,11 +446,214 @@
 0;%0A    %7D
+%0A%0A    public boolean movementIsNegligible() %7B%0A        float ax = Math.abs(acc.x);%0A        float ay = Math.abs(acc.y);%0A%0A        return ( TRIVIALITY_THRESHOLD %3E ay ) && ( TRIVIALITY_THRESHOLD %3E ax );%0A    %7D
 %0A%7D%0A

Add a threshold to avoid gratuitous movements from small touches