I am trying to use ViewPropertyAnimator to scale the view (undefined ProgressBar) every time I click the button.
loadingCircle.animate().scaleY(1.5f).scaleX(1.5f).setDuration(100f);
I have an animatorListener that returns to normal on an AnimationEnd:
loadingCircle.animate().scaleY(1.0f).scaleX(1.0f).setDuration(100f);
Nothing complicated. However, it does not seem to always scale both x and y always.
Usually he does it right the first time, sometimes the second time. When it does not work, it only enlivens the last operation in the chain. If it is scaleX, it will scale only X. If I change it, it will scale only Y.
The documentation for scaleX and scaleY says:
Animations already running in the property will be canceled.
However, I thought that ViewPropertyAnimator could be attached, and this comment applies only to new animations (on a different line of code). Am I doing something wrong, or have I found a mistake?
I am running Android 4.2.2 on GalaxyS4. Stock ROM, but rooted. If that matters.
android animation view scale
Xebozone
source share