Class StateListAnimator

java.lang.Object
icyllis.modernui.animation.StateListAnimator
All Implemented Interfaces:
Cloneable

public class StateListAnimator extends Object implements Cloneable
Lets you define a number of Animators that will run on the attached View depending on the View's drawable state.
Since:
3.3.1
  • Constructor Details

    • StateListAnimator

      public StateListAnimator()
  • Method Details

    • addState

      public void addState(@Nonnull int[] spec, @Nonnull Animator animator)
      Associates the given animator with the provided drawable state spec so that it will be run when the View's drawable state matches the spec.
      Parameters:
      spec - The drawable state spec to match against
      animator - The animator to run when the spec match
    • setTarget

      @Internal public void setTarget(@Nullable View view)
      Called by View
    • setState

      @Internal public void setState(@Nonnull int[] state)
      Called by View
    • jumpToCurrentState

      public void jumpToCurrentState()
      If there is an animation running for a recent state change, ends it.

      This causes the animation to assign the end value(s) to the View.

    • clone

      public StateListAnimator clone()
      Overrides:
      clone in class Object