// Path: pinchtozoom/src/main/java/com/bogdwellers/pinchtozoom/ImageMatrixCorrector.java
// public abstract class ImageMatrixCorrector extends MatrixCorrector {
// 	
// 	/*
// 	 * Attributes
// 	 */
// 
// 	private ImageView imageView;
// 	private float scaledImageWidth;
// 	private float scaledImageHeight;
// 
// 	/*
// 	 * Overrides
// 	 */
// 
// 	@Override
// 	public void setMatrix(Matrix matrix) {
// 		super.setMatrix(matrix);
// 		updateScaledImageDimensions();
// 	}
// 
// 	/*
// 	 * Class methods
// 	 */
// 	
// 	/**
// 	 * <p>Sets the <code>ImageView</code>. This also sets its inner image matrix as this corrector's matrix automatically.</p>
// 	 * @param imageView
// 	 */
// 	public void setImageView(ImageView imageView) {
// 		// TODO Make a weak reference or set to null in order to avoid memory leaks
// 		this.imageView = imageView;
// 		if(imageView != null) {
// 			setMatrix(imageView.getImageMatrix());
// 		}
// 	}
// 
// 	/**
// 	 *
// 	 * @return
//      */
// 	public ImageView getImageView() {
// 		return imageView;
// 	}
// 
// 	/**
// 	 *
// 	 * @return
//      */
// 	public float getInnerFitScale() {
// 		Drawable drawable = imageView.getDrawable();
// 		float widthRatio = (float) drawable.getIntrinsicWidth() / imageView.getWidth();
// 		float heightRatio = (float) drawable.getIntrinsicHeight() / imageView.getHeight();
// 		if(widthRatio > heightRatio) {
// 			return 1f / widthRatio;
// 		} else {
// 			return 1f / heightRatio;
// 		}
// 	}
// 	
// 	/**
// 	 * <p>(Re)calculates the image's current dimensions.</p>
// 	 */
// 	protected void updateScaledImageDimensions() {
// 		float[] values = getValues();
// 		Drawable drawable = imageView.getDrawable();
// 		if(drawable != null) {
// 			scaledImageWidth = values[Matrix.MSCALE_X] * drawable.getIntrinsicWidth();
// 			scaledImageHeight = values[Matrix.MSCALE_Y] * drawable.getIntrinsicHeight();
// 		} else {
// 			scaledImageWidth = scaledImageHeight = 0f;
// 		}
// 	}
// 
// 	/**
// 	 * <p>Returns the width of the scaled image.</p>
// 	 * @return
//      */
// 	protected float getScaledImageWidth() {
// 		return scaledImageWidth;
// 	}
// 
// 	/**
// 	 * * <p>Returns the height of the scaled image.</p>
// 	 * @return
//      */
// 	protected float getScaledImageHeight() {
// 		return scaledImageHeight;
// 	}
// }


import android.animation.ValueAnimator;
import android.graphics.Matrix;
import android.widget.ImageView;
import com.bogdwellers.pinchtozoom.ImageMatrixCorrector;
package com.bogdwellers.pinchtozoom.animation;



/**
 * Created by Martin on 12-10-2016.
 */

public class FlingAnimatorHandler extends AbsCorrectorAnimatorHandler {

    public static final String PROPERTY_TRANSLATE_X = "translateX";
    public static final String PROPERTY_TRANSLATE_Y = "translateY";

    public FlingAnimatorHandler(ImageMatrixCorrector corrector) {
        super(corrector);
    }

    @Override
    public void onAnimationUpdate(ValueAnimator animation) {
// Path: pinchtozoom/src/main/java/com/bogdwellers/pinchtozoom/ImageMatrixCorrector.java
// public abstract class ImageMatrixCorrector extends MatrixCorrector {
// 	
// 	/*
// 	 * Attributes
// 	 */
// 
// 	private ImageView imageView;
// 	private float scaledImageWidth;
// 	private float scaledImageHeight;
// 
// 	/*
// 	 * Overrides
// 	 */
// 
// 	@Override
// 	public void setMatrix(Matrix matrix) {
// 		super.setMatrix(matrix);
// 		updateScaledImageDimensions();
// 	}
// 
// 	/*
// 	 * Class methods
// 	 */
// 	
// 	/**
// 	 * <p>Sets the <code>ImageView</code>. This also sets its inner image matrix as this corrector's matrix automatically.</p>
// 	 * @param imageView
// 	 */
// 	public void setImageView(ImageView imageView) {
// 		// TODO Make a weak reference or set to null in order to avoid memory leaks
// 		this.imageView = imageView;
// 		if(imageView != null) {
// 			setMatrix(imageView.getImageMatrix());
// 		}
// 	}
// 
// 	/**
// 	 *
// 	 * @return
//      */
// 	public ImageView getImageView() {
// 		return imageView;
// 	}
// 
// 	/**
// 	 *
// 	 * @return
//      */
// 	public float getInnerFitScale() {
// 		Drawable drawable = imageView.getDrawable();
// 		float widthRatio = (float) drawable.getIntrinsicWidth() / imageView.getWidth();
// 		float heightRatio = (float) drawable.getIntrinsicHeight() / imageView.getHeight();
// 		if(widthRatio > heightRatio) {
// 			return 1f / widthRatio;
// 		} else {
// 			return 1f / heightRatio;
// 		}
// 	}
// 	
// 	/**
// 	 * <p>(Re)calculates the image's current dimensions.</p>
// 	 */
// 	protected void updateScaledImageDimensions() {
// 		float[] values = getValues();
// 		Drawable drawable = imageView.getDrawable();
// 		if(drawable != null) {
// 			scaledImageWidth = values[Matrix.MSCALE_X] * drawable.getIntrinsicWidth();
// 			scaledImageHeight = values[Matrix.MSCALE_Y] * drawable.getIntrinsicHeight();
// 		} else {
// 			scaledImageWidth = scaledImageHeight = 0f;
// 		}
// 	}
// 
// 	/**
// 	 * <p>Returns the width of the scaled image.</p>
// 	 * @return
//      */
// 	protected float getScaledImageWidth() {
// 		return scaledImageWidth;
// 	}
// 
// 	/**
// 	 * * <p>Returns the height of the scaled image.</p>
// 	 * @return
//      */
// 	protected float getScaledImageHeight() {
// 		return scaledImageHeight;
// 	}
// }


// Path: pinchtozoom/src/main/java/com/bogdwellers/pinchtozoom/animation/FlingAnimatorHandler.java
import android.animation.ValueAnimator;
import android.graphics.Matrix;
import android.widget.ImageView;
import com.bogdwellers.pinchtozoom.ImageMatrixCorrector;

package com.bogdwellers.pinchtozoom.animation;



/**
 * Created by Martin on 12-10-2016.
 */

public class FlingAnimatorHandler extends AbsCorrectorAnimatorHandler {

    public static final String PROPERTY_TRANSLATE_X = "translateX";
    public static final String PROPERTY_TRANSLATE_Y = "translateY";

    public FlingAnimatorHandler(ImageMatrixCorrector corrector) {
        super(corrector);
    }

    @Override
    public void onAnimationUpdate(ValueAnimator animation) {
        ImageMatrixCorrector corrector = getCorrector();