Package icyllis.modernui.animation
Class AnimationHandler
java.lang.Object
icyllis.modernui.animation.AnimationHandler
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Callbacks that receives notifications for animation timing. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFrameCallback
(AnimationHandler.FrameCallback callback, long delay) Register to get a callback on the next frame after the delay.static int
Return the number of callbacks that have registered for frame callbacks.static AnimationHandler
void
removeCallback
(AnimationHandler.FrameCallback callback) Removes the given callback from the list, so it will no longer be called for frame related timing.
-
Method Details
-
getInstance
-
getAnimationCount
public static int getAnimationCount()Return the number of callbacks that have registered for frame callbacks. -
addFrameCallback
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 registerdelay
- delayed time in milliseconds, if > 0
-
removeCallback
Removes the given callback from the list, so it will no longer be called for frame related timing.- Parameters:
callback
- the callback to unregister
-