I am trying to animate the image using scale and rotate properties. I am able to start the animation. But how to do the reverse one from the animated position instead of the actual position of the image.
AnimatorSet animation = new AnimatorSet();
private void rotateImage(boolean isReverse) {
if(isReverse){
animation.playTogether(
ObjectAnimator.ofFloat(fingerPrintImage, "rotation", 0, 60),
ObjectAnimator.ofFloat(fingerPrintImage, "scaleX", 1, 0.5f),
ObjectAnimator.ofFloat(fingerPrintImage, "scaleY", 1, 0.5f)
);
}
else {
animation.playTogether(
ObjectAnimator.ofFloat(fingerPrintImage, "rotation", 0, 60),
ObjectAnimator.ofFloat(fingerPrintImage, "scaleX", 1, 1.3f),
ObjectAnimator.ofFloat(fingerPrintImage, "scaleY", 1, 1.3f)
);
}
animation.setDuration(5000);
animation.start();
}
rotateImage(true);