Class AnimationHandler

java.lang.Object
icyllis.modernui.animation.AnimationHandler

@Internal public class AnimationHandler extends Object
This custom, static handler handles the timing pulse that is shared by all active ValueAnimators. This approach ensures that the setting of animation values will happen on the same thread that animations start on, and that all animations will share the same times for calculating their values, which makes synchronizing animations possible.
  • Method Details

    • getInstance

      @NonNull public static AnimationHandler getInstance()
    • getAnimationCount

      public static int getAnimationCount()
      Return the number of callbacks that have registered for frame callbacks.
    • addFrameCallback

      public void addFrameCallback(@NonNull AnimationHandler.FrameCallback callback, long delay)
      Register to get a callback on the next frame after the delay. If the callback is ever registered, the delay will be overridden.
      Parameters:
      callback - the callback to register
      delay - delayed time in milliseconds, if > 0
    • removeCallback

      public void removeCallback(@NonNull AnimationHandler.FrameCallback callback)
      Removes the given callback from the list, so it will no longer be called for frame related timing.
      Parameters:
      callback - the callback to unregister