public abstract class AnimationScheduler extends Object
GWT.UncaughtExceptionHandler
if one is
installed.Modifier and Type | Class and Description |
---|---|
static interface |
AnimationScheduler.AnimationCallback
The callback used when an animation frame becomes available.
|
static class |
AnimationScheduler.AnimationHandle
A handle to the requested animation frame created by
requestAnimationFrame(AnimationCallback, Element) . |
Constructor and Description |
---|
AnimationScheduler() |
Modifier and Type | Method and Description |
---|---|
static AnimationScheduler |
get()
Returns the default implementation of the AnimationScheduler API.
|
AnimationScheduler.AnimationHandle |
requestAnimationFrame(AnimationScheduler.AnimationCallback callback)
Schedule an animation, letting the browser decide when to trigger the next
step in the animation.
|
abstract AnimationScheduler.AnimationHandle |
requestAnimationFrame(AnimationScheduler.AnimationCallback callback,
Element element)
Schedule an animation, letting the browser decide when to trigger the next
step in the animation.
|
public static AnimationScheduler get()
public AnimationScheduler.AnimationHandle requestAnimationFrame(AnimationScheduler.AnimationCallback callback)
NOTE: If you are animating an element, use
requestAnimationFrame(AnimationCallback, Element)
instead so the
browser can optimize for the specified element.
Using this method instead of a timeout is preferred because the browser is in the best position to decide how frequently to trigger the callback for an animation of the specified element. The browser can balance multiple animations and trigger callbacks at the optimal rate for smooth performance.
callback
- the callback to firerequestAnimationFrame(AnimationCallback, Element)
public abstract AnimationScheduler.AnimationHandle requestAnimationFrame(AnimationScheduler.AnimationCallback callback, Element element)
Using this method instead of a timeout is preferred because the browser is in the best position to decide how frequently to trigger the callback for an animation of the specified element. The browser can balance multiple animations and trigger callbacks at the optimal rate for smooth performance.
callback
- the callback to fireelement
- the element being animatedCopyright © 2018. All rights reserved.