This is just a shot in the dark, but I'm think I know a way this can be done. First, get all the points that the user has drawn along the line in an array of some sort. After you get that array, you can use an ImageView with its built in animations to do a very quick tween animation between every point in your array. That would account for any shape of line that the user could draw, including loops, etc...
Here's a little bit of quasi-code as an example:
To get an array of points (I'm assuming you're already doing something like this to make your path), where the Point object is just a simple helper object with getters and setters:
Using java Syntax Highlighting
private ArrayList <Point> points;
...
public void onTouchEvent(MotionEvent event) {
points.add(new Point(event.getX(), event.getY()));
isNormalized = false;
}
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4
To make a tween animation, in your class that has the image you want to use set as the resource for an ImageView object, you can programatically construct an animation something like what I have below:
Using java Syntax Highlighting
yourImageViewObject = new ImageView();
yourImageViewObject.setImageResource(yourImage);
private void tweenPointAnim() {
for (loop through arraylist of points) {
Point firstPoint = pointList.get(whatever);
Point secondPoint = pointList.get(whatever);
Animation anim = new TranslateAnimation(firstPoint.getX(), firstPoint.getY(), secondPoint.getX(), secondPoint.getY());
anim.setDuration(some int);
yourImageViewObject.startAnimation(anim);
}
}
Parsed in 0.032 seconds, using
GeSHi 1.0.8.4