This class is used to animate an HTMLElement and provide a set of method to configure the animation and register callbacks like, onBeforeStart and onComplete
Example:
Animation.create(htmlElement)
.duration(1000)
.transition(Transition.BOUNCE)
.animate();
See also :
public void Animation(Element element)
element
an Element to be animated
public void Animation(HTMLElement element, int duration, int delay, boolean infinite)
element
an Element to be animated
duration
int duration of animation in milliseconds
delay
int delay in millisecond before the animation starts
infinite
boolean repeat this animation infinitely or until stop is called
public static Animation create(Element element)
public static Animation create(IsElement<?> element)
element
an IsElement to be animated
an Animation instance
public Animation duration(int duration)
duration
int duration in milliseconds
same instance
public Animation delay(int delay)
delay
in delay in milliseconds
same instance
public Animation infinite()
same instance
public boolean isInfinite()
true if the animation repeats infinitely, false otherwise
public Animation setInfinite(boolean infinite)
infinite
boolean value indicating if the animation should repeat infinitely. Pass true to make the animation repeat indefinitely, or false to disable infinite repetition.
the current instance of the Animation class for method chaining.
public Animation transition(Transition transition)
public Animation repeat(double repeatCount)
repeatCount
double, The number of times the animation to be repeated, Example 2.5 repeats the animation 2 times and a half
same instance
public Animation callback(CompleteCallback callback)
callback
a CompleteCallback to be executed
same instance
public Animation beforeStart(StartHandler startHandler)
startHandler
StartHandler to be executed
same instance
public Animation animate()
same instance
public void stop()
public void stop(boolean silent)
silent
boolean, true to ignore the callback when animation completed, false to execute the callback.