An alternative approach I've used to add multiple properties to an object's animation is to use a mix of code and XML to define the animation. This is based on this documentation
For example, in XML I can setup AnimatorSets and ObjectAnimators for a single object with static values, and define a sequential sequence of changes (res/animator/moveout.xml)
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially">
<set>
<objectAnimator
android:propertyName="scaleX"
android:duration="2000"
android:valueTo="0.8"
android:interpolator="@android:anim/decelerate_interpolator"/>
<objectAnimator
android:propertyName="scaleY"
android:duration="2000"
android:valueTo="0.8"
android:interpolator="@android:anim/decelerate_interpolator"/>
<objectAnimator
android:propertyName="alpha"
android:duration="2000"
android:valueTo="0"
android:interpolator="@android:anim/decelerate_interpolator"/>
</set>
<set>
<objectAnimator
android:propertyName="scaleX"
android:duration="2000"
android:valueTo="1.2"
android:interpolator="@android:anim/accelerate_interpolator"/>
<objectAnimator
android:propertyName="scaleY"
android:duration="2000"
android:valueTo="1.2"
android:interpolator="@android:anim/accelerate_interpolator"/>
<objectAnimator
android:propertyName="alpha"
android:duration="2000"
android:valueTo="1"
android:interpolator="@android:anim/accelerate_interpolator"/>
</set>
</set>
Then I can load these AnimatorSets/ObjectAnimators at runtime and modify their values with dynamically generated values:
AnimatorSet firstSet = (AnimatorSet) AnimatorInflater.loadAnimator(this,
R.animator.moveout);
AnimatorSet secondSet = firstSet.clone();
firstSet.setTarget(button);
secondSet.setTarget(anotherButton);
// Choreograph the animations
// Change the duration of all child elements in the set
firstSet.setDuration(1000);
secondSet.setDuration(200);
// Set start delay so second set plays after the first set
secondSet.setStartDelay(2000);
AnimatorSet anim = new AnimatorSet();
anim.playTogether(firstSet,secondSet);
anim.start();