Package 

Class SwipeDirectionDetector

    • Method Summary

      Modifier and Type Method Description
      abstract void onDirectionDetected(SwipeDirectionDetector.Direction direction)
      boolean onTouchEvent(MotionEvent event)
      SwipeDirectionDetector.Direction getDirection(float x1, float y1, float x2, float y2) Given two points in the plane p1=(x1, x2) and p2=(y1, y1), this method returns the direction that an arrow pointing from p1 to p2 would have.
      double getAngle(float x1, float y1, float x2, float y2) Finds the angle between two points in the plane (x1,y1) and (x2, y2) The angle is measured with 0/360 being the X-axis to the right, angles increase counter clockwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwipeDirectionDetector

        SwipeDirectionDetector(Context context)
    • Method Detail

      • getDirection

         SwipeDirectionDetector.Direction getDirection(float x1, float y1, float x2, float y2)

        Given two points in the plane p1=(x1, x2) and p2=(y1, y1), this method returns the direction that an arrow pointing from p1 to p2 would have.

        Parameters:
        x1 - the x position of the first point
        y1 - the y position of the first point
        x2 - the x position of the second point
        y2 - the y position of the second point
      • getAngle

         double getAngle(float x1, float y1, float x2, float y2)

        Finds the angle between two points in the plane (x1,y1) and (x2, y2) The angle is measured with 0/360 being the X-axis to the right, angles increase counter clockwise.

        Parameters:
        x1 - the x position of the first point
        y1 - the y position of the first point
        x2 - the x position of the second point
        y2 - the y position of the second point