Search code examples
androidpathruntimetrackingdirection

How to track path direction in android?


I am having a View class where I am drawing paths through finger touch(bitmaps and canvas). I need to keep track of the direction of path while my finger is moving on it. Android developer page doesn't give much information on Path.Direction. Any help with this?


Solution

  • You need to add an OnMotionEvent listener to your view and either use a Gesture Detector or manually work out the difference in X and Y axis and track the movement yourself