Package icyllis.modernui.animation

# 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 Summary

  Constructors
  Constructor
  Description
  `StateListAnimator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addState(int[] spec, 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.
  `StateListAnimator`
  `clone()`
  `void`
  `jumpToCurrentState()`
  If there is an animation running for a recent state change, ends it.
  `void`
  `setState(int[] state)`
  Called by View
  `void`
  `setTarget(View view)`
  Called by View

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`