// Path: Linkup/src/com/znv/linkup/view/animation/path/AnimatorPath.java
// public class AnimatorPath {
// 
//     // The points in the path
//     ArrayList<PathPoint> mPoints = new ArrayList<PathPoint>();
// 
// 
//     /**
//      * Move from the current path point to the new one
//      * specified by x and y. This will create a discontinuity if this point is
//      * neither the first point in the path nor the same as the previous point
//      * in the path.
//      */
//     public void moveTo(float x, float y) {
//         mPoints.add(PathPoint.moveTo(x, y));
//     }
// 
//     /**
//      * Create a straight line from the current path point to the new one
//      * specified by x and y.
//      */
//     public void lineTo(float x, float y) {
//         mPoints.add(PathPoint.lineTo(x, y));
//     }
// 
//     /**
//      * Create a cubic B�zier curve from the current path point to the new one
//      * specified by x and y. The curve uses the current path location as the first anchor
//      * point, the control points (c0X, c0Y) and (c1X, c1Y), and (x, y) as the end anchor point.
//      */
//     public void curveTo(float c0X, float c0Y, float c1X, float c1Y, float x, float y) {
//         mPoints.add(PathPoint.curveTo(c0X, c0Y, c1X, c1Y, x, y));
//     }
// 
//     /**
//      * Returns a Collection of PathPoint objects that describe all points in the path.
//      */
//     public Collection<PathPoint> getPoints() {
//         return mPoints;
//     }
// }
// 
// Path: Linkup/src/com/znv/linkup/view/animation/path/PathEvaluator.java
// public class PathEvaluator implements TypeEvaluator<PathPoint> {
//     @Override
//     public PathPoint evaluate(float t, PathPoint startValue, PathPoint endValue) {
//         float x, y;
//         if (endValue.mOperation == PathPoint.CURVE) {
//             float oneMinusT = 1 - t;
//             x = oneMinusT * oneMinusT * oneMinusT * startValue.mX +
//                     3 * oneMinusT * oneMinusT * t * endValue.mControl0X +
//                     3 * oneMinusT * t * t * endValue.mControl1X +
//                     t * t * t * endValue.mX;
//             y = oneMinusT * oneMinusT * oneMinusT * startValue.mY +
//                     3 * oneMinusT * oneMinusT * t * endValue.mControl0Y +
//                     3 * oneMinusT * t * t * endValue.mControl1Y +
//                     t * t * t * endValue.mY;
//         } else if (endValue.mOperation == PathPoint.LINE) {
//             x = startValue.mX + t * (endValue.mX - startValue.mX);
//             y = startValue.mY + t * (endValue.mY - startValue.mY);
//         } else {
//             x = endValue.mX;
//             y = endValue.mY;
//         }
//         return PathPoint.moveTo(x, y);
//     }
// }
// 
// Path: Linkup/src/com/znv/linkup/view/animation/view/IAnimatorView.java
// public interface IAnimatorView {
//     /**
//      * 设置定位点
//      * 
//      * @param pp
//      *            路径点
//      */
//     void setLocation(PathPoint pp);
// 
//     /**
//      * 设置透明度
//      * 
//      * @param alpha
//      *            alpha值，0~1f
//      */
//     void setAlpha(float alpha);
// }


import java.util.ArrayList;
import java.util.List;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ObjectAnimator;
import android.graphics.Point;
import com.znv.linkup.view.animation.path.AnimatorPath;
import com.znv.linkup.view.animation.path.PathEvaluator;
import com.znv.linkup.view.animation.view.IAnimatorView;
package com.znv.linkup.view.animation;




/**
 * 文字或者图片的动画
 * 
 * @author yzb
 * 
 */
public class ViewPathAnimator implements AnimatorListener {

    private IAnimatorView view = null;
    private int duration = 400;

    public ViewPathAnimator(IAnimatorView view) {
        this.view = view;
    }

    /**
     * 设置动画的起始点
     * 
     * @param start
     *            动画起点
     * @param end
     *            动画终点
     */
    public void animatePath(Point start, Point end) {
        List<Point> pathPoints = new ArrayList<Point>();
        pathPoints.add(start);
        pathPoints.add(end);
        animatePath(pathPoints);
    }

    /**
     * 设置动画的起始点
     * 
     * @param pathPoints
     *            路径点
     */
    public void animatePath(List<Point> pathPoints) {
        if (pathPoints == null || pathPoints.size() == 0) {
            return;
        }
// Path: Linkup/src/com/znv/linkup/view/animation/path/AnimatorPath.java
// public class AnimatorPath {
// 
//     // The points in the path
//     ArrayList<PathPoint> mPoints = new ArrayList<PathPoint>();
// 
// 
//     /**
//      * Move from the current path point to the new one
//      * specified by x and y. This will create a discontinuity if this point is
//      * neither the first point in the path nor the same as the previous point
//      * in the path.
//      */
//     public void moveTo(float x, float y) {
//         mPoints.add(PathPoint.moveTo(x, y));
//     }
// 
//     /**
//      * Create a straight line from the current path point to the new one
//      * specified by x and y.
//      */
//     public void lineTo(float x, float y) {
//         mPoints.add(PathPoint.lineTo(x, y));
//     }
// 
//     /**
//      * Create a cubic B�zier curve from the current path point to the new one
//      * specified by x and y. The curve uses the current path location as the first anchor
//      * point, the control points (c0X, c0Y) and (c1X, c1Y), and (x, y) as the end anchor point.
//      */
//     public void curveTo(float c0X, float c0Y, float c1X, float c1Y, float x, float y) {
//         mPoints.add(PathPoint.curveTo(c0X, c0Y, c1X, c1Y, x, y));
//     }
// 
//     /**
//      * Returns a Collection of PathPoint objects that describe all points in the path.
//      */
//     public Collection<PathPoint> getPoints() {
//         return mPoints;
//     }
// }
// 
// Path: Linkup/src/com/znv/linkup/view/animation/path/PathEvaluator.java
// public class PathEvaluator implements TypeEvaluator<PathPoint> {
//     @Override
//     public PathPoint evaluate(float t, PathPoint startValue, PathPoint endValue) {
//         float x, y;
//         if (endValue.mOperation == PathPoint.CURVE) {
//             float oneMinusT = 1 - t;
//             x = oneMinusT * oneMinusT * oneMinusT * startValue.mX +
//                     3 * oneMinusT * oneMinusT * t * endValue.mControl0X +
//                     3 * oneMinusT * t * t * endValue.mControl1X +
//                     t * t * t * endValue.mX;
//             y = oneMinusT * oneMinusT * oneMinusT * startValue.mY +
//                     3 * oneMinusT * oneMinusT * t * endValue.mControl0Y +
//                     3 * oneMinusT * t * t * endValue.mControl1Y +
//                     t * t * t * endValue.mY;
//         } else if (endValue.mOperation == PathPoint.LINE) {
//             x = startValue.mX + t * (endValue.mX - startValue.mX);
//             y = startValue.mY + t * (endValue.mY - startValue.mY);
//         } else {
//             x = endValue.mX;
//             y = endValue.mY;
//         }
//         return PathPoint.moveTo(x, y);
//     }
// }
// 
// Path: Linkup/src/com/znv/linkup/view/animation/view/IAnimatorView.java
// public interface IAnimatorView {
//     /**
//      * 设置定位点
//      * 
//      * @param pp
//      *            路径点
//      */
//     void setLocation(PathPoint pp);
// 
//     /**
//      * 设置透明度
//      * 
//      * @param alpha
//      *            alpha值，0~1f
//      */
//     void setAlpha(float alpha);
// }


// Path: Linkup/src/com/znv/linkup/view/animation/ViewPathAnimator.java
import java.util.ArrayList;
import java.util.List;
import android.animation.Animator;
import android.animation.Animator.AnimatorListener;
import android.animation.ObjectAnimator;
import android.graphics.Point;
import com.znv.linkup.view.animation.path.AnimatorPath;
import com.znv.linkup.view.animation.path.PathEvaluator;
import com.znv.linkup.view.animation.view.IAnimatorView;

package com.znv.linkup.view.animation;




/**
 * 文字或者图片的动画
 * 
 * @author yzb
 * 
 */
public class ViewPathAnimator implements AnimatorListener {

    private IAnimatorView view = null;
    private int duration = 400;

    public ViewPathAnimator(IAnimatorView view) {
        this.view = view;
    }

    /**
     * 设置动画的起始点
     * 
     * @param start
     *            动画起点
     * @param end
     *            动画终点
     */
    public void animatePath(Point start, Point end) {
        List<Point> pathPoints = new ArrayList<Point>();
        pathPoints.add(start);
        pathPoints.add(end);
        animatePath(pathPoints);
    }

    /**
     * 设置动画的起始点
     * 
     * @param pathPoints
     *            路径点
     */
    public void animatePath(List<Point> pathPoints) {
        if (pathPoints == null || pathPoints.size() == 0) {
            return;
        }
        AnimatorPath path = new AnimatorPath();