package com.tianma.propertyanimationsample;

import android.animation.TypeEvaluator;

/**
 * This is a TypeEvaluator of point.
 */
public class PointEvaluator implements TypeEvaluator<Point> {
    @Override
    public Point evaluate(float fraction, Point startValue, Point endValue) {
        float currentX = startValue.getX() + fraction * (endValue.getX() - startValue.getX());
        float currentY = startValue.getY() + fraction * (endValue.getY() - startValue.getY());
        // Return current Point
        return new Point(currentX, currentY);
    }
}
