Class ModelAnimation.PropertyValuesHolder

  • Enclosing class:
    ModelAnimation

    public static class ModelAnimation.PropertyValuesHolder
    extends java.lang.Object
    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.

    Using this ModelAnimation.PropertyValuesHolder provide an handled ModelAnimator canceling since we target a same object and those PropertyValuesHolder have the same property name

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static android.animation.PropertyValuesHolder ofFraction​(float... fractions)
      Constructs and returns a PropertyValuesHolder with a given set of fraction values.
      static android.animation.PropertyValuesHolder ofFrame​(int... frames)
      Constructs and returns a PropertyValuesHolder with a given set of frame values.
      static android.animation.PropertyValuesHolder ofTime​(float... times)
      Constructs and returns a PropertyValuesHolder with a given set of time values.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyValuesHolder

        public PropertyValuesHolder()
    • Method Detail

      • ofTime

        public static android.animation.PropertyValuesHolder ofTime​(float... times)
        Constructs and returns a PropertyValuesHolder with a given set of time values.
        Parameters:
        times - The times that the ModelAnimation will animate between. A time value must be between 0 and ModelAnimation.getDuration()
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofFrame

        public static android.animation.PropertyValuesHolder ofFrame​(int... frames)
        Constructs and returns a PropertyValuesHolder with a given set of frame values. Warning Every PropertyValuesHolder that applies a modification on the time position of the animation should use the ModelAnimation.TIME_POSITION instead of its own Property in order to possibly cancel any ObjectAnimator operating time modifications on the same ModelAnimation. ObjectAnimator.setAutoCancel(boolean) will have no effect for different property names

        That's why we avoid using an ModelAnimation.FRAME_POSITION or ModelAnimation.FRACTION_POSITION Property

        Parameters:
        frames - The frames that the ModelAnimation will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.
      • ofFraction

        public static android.animation.PropertyValuesHolder ofFraction​(float... fractions)
        Constructs and returns a PropertyValuesHolder with a given set of fraction values. Warning Every PropertyValuesHolder that applies a modification on the time position of the animation should use the ModelAnimation.TIME_POSITION instead of its own Property in order to possibly cancel any ObjectAnimator operating time modifications on the same ModelAnimation. ObjectAnimator.setAutoCancel(boolean) will have no effect for different property names

        That's why we avoid using an ModelAnimation.FRAME_POSITION or ModelAnimation.FRACTION_POSITION Property

        Parameters:
        fractions - The fractions that the ModelAnimation will animate between.
        Returns:
        PropertyValuesHolder The constructed PropertyValuesHolder object.