// Path: Linkup/src/com/znv/linkup/view/animation/HideAnimator.java
// public class HideAnimator implements AnimatorListener {
// 
//     private View view = null;
// 
//     public HideAnimator(View view) {
//         this.view = view;
//     }
// 
//     @Override
//     public void onAnimationEnd(Animator animation) {
//         view.setVisibility(View.GONE);
//     }
// 
//     @Override
//     public void onAnimationRepeat(Animator animation) {
//     }
// 
//     @Override
//     public void onAnimationStart(Animator animation) {
//         view.setVisibility(View.VISIBLE);
//     }
// 
//     @Override
//     public void onAnimationCancel(Animator animation) {
//         
//     }
// 
// }


import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.view.View;
import com.znv.linkup.view.animation.HideAnimator;

    /**
     * 平移动画
     * 
     * @param view
     *            执行动画的view
     * @param fromX
     *            起始X坐标
     * @param toX
     *            结束X坐标
     * @param fromY
     *            起始Y坐标
     * @param toY
     *            结束Y坐标
     * @param duration
     *            动画时长
     */
    public static void animTranslate(View view, float fromX, float toX, float fromY, float toY, int duration, int delay, boolean isHide) {
        Animator animX = ObjectAnimator.ofFloat(view, "translationX", fromX, toX).setDuration(duration);
        Animator animY = ObjectAnimator.ofFloat(view, "translationY", fromY, toY).setDuration(duration);

        if (fromX != toX) {
            animX.setStartDelay(delay);
            animX.start();
        } else {
            view.setTranslationX(fromX);
        }
        if (fromY != toY) {
            animY.setStartDelay(delay);
            if (isHide) {
// Path: Linkup/src/com/znv/linkup/view/animation/HideAnimator.java
// public class HideAnimator implements AnimatorListener {
// 
//     private View view = null;
// 
//     public HideAnimator(View view) {
//         this.view = view;
//     }
// 
//     @Override
//     public void onAnimationEnd(Animator animation) {
//         view.setVisibility(View.GONE);
//     }
// 
//     @Override
//     public void onAnimationRepeat(Animator animation) {
//     }
// 
//     @Override
//     public void onAnimationStart(Animator animation) {
//         view.setVisibility(View.VISIBLE);
//     }
// 
//     @Override
//     public void onAnimationCancel(Animator animation) {
//         
//     }
// 
// }


// Path: Linkup/src/com/znv/linkup/util/AnimatorUtil.java
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.view.View;
import com.znv.linkup.view.animation.HideAnimator;


    /**
     * 平移动画
     * 
     * @param view
     *            执行动画的view
     * @param fromX
     *            起始X坐标
     * @param toX
     *            结束X坐标
     * @param fromY
     *            起始Y坐标
     * @param toY
     *            结束Y坐标
     * @param duration
     *            动画时长
     */
    public static void animTranslate(View view, float fromX, float toX, float fromY, float toY, int duration, int delay, boolean isHide) {
        Animator animX = ObjectAnimator.ofFloat(view, "translationX", fromX, toX).setDuration(duration);
        Animator animY = ObjectAnimator.ofFloat(view, "translationY", fromY, toY).setDuration(duration);

        if (fromX != toX) {
            animX.setStartDelay(delay);
            animX.start();
        } else {
            view.setTranslationX(fromX);
        }
        if (fromY != toY) {
            animY.setStartDelay(delay);
            if (isHide) {
                animY.addListener(new HideAnimator(view));