PropertyValuesHolder

This class holds information about a property and the values that that property should take during an animation.

PropertyValuesHolder objects can be used to create animations with ObjectAnimator or that operate on several different properties in parallel.

Warning:

Using this PropertyValuesHolder is very useful for targeting multiple time or frame properties of multiple animations inside a same ObjectAnimator model

and insure a less consuming android.view.Choreographer.FrameCallback than using playTogether

but If you want to use the setAutoCancel functionality, you have to take care of this :

ObjectAnimator.hasSameTargetAndProperties(Animator anim) {
     PropertyValuesHolder[] theirValues = ((ObjectAnimator) anim).getValues();
     if (((ObjectAnimator) anim).getTarget() == getTarget() &&
             mValues.length == theirValues.length) {
         for (int i = 0; i < mValues.length; ++i) {
             PropertyValuesHolder pvhMine = mValues[i];
             PropertyValuesHolder pvhTheirs = theirValues[i];
             if (pvhMine.getPropertyName() == null ||
                     !pvhMine.getPropertyName().equals(pvhTheirs.getPropertyName())) {
                 return false;
             }
         }
         return true;
     }
 }

See also

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Constructs and returns a PropertyValuesHolder for a targeted ModelAnimation.
Link copied to clipboard
open fun ofAnimationFraction(animationName: String, fractions: Array<Float>): PropertyValuesHolder
Constructs and returns a PropertyValuesHolder for a targeted ModelAnimation with a given set of fraction values.
Link copied to clipboard
Constructs and returns a PropertyValuesHolder for a targeted ModelAnimation with a given set of frame values.
open fun ofAnimationFrame(animationName: String, frames: Array<Int>): PropertyValuesHolder
Constructs and returns a PropertyValuesHolder for a targeted ModelAnimation with a given set of fame values.
Link copied to clipboard
Constructs and returns a PropertyValuesHolder for a targeted ModelAnimation with a given set of time values.
open fun ofAnimationTime(animationName: String, times: Array<Float>): PropertyValuesHolder
Constructs and returns a PropertyValuesHolder for a targeted animation set of time values.