Can you have multiple interpolators on a single view when using ViewPropertyAnimator?
- by steven
For example, I would like to animate a view such that it moves down in the y direction while decelerating, and at the same time it undergoes an alpha change linearly.
The code would look something like this:
myView.animate().translationY(100).setDuration(1000).setInterpolator(new DecelerateInterpolator());
myView.animate().alpha(1).setDuration(1000).setInterpolator(new LinearInterpolator());
This does not work of course because the LinearInterpolator overwrites the DecelerateInterpolator. Is there a way to have one interpolator for the translation part of the animation and a different interpolator for the alpha part?
I am aware that this can be accomplished using ObjectAnimator or an AnimationSet, but my question is about whether it can be done using the much cleaner ViewPropertyAnimator.