public class StubAnimationScheduler extends AnimationScheduler
AnimationScheduler
that does not execute the
callbacks. Use getAnimationCallbacks()
to
retrieve and execute callbacks manually.Modifier and Type | Class and Description |
---|---|
class |
StubAnimationScheduler.StubAnimationHandle
A handle to the requested animation frame created by
AnimationScheduler.requestAnimationFrame(AnimationCallback, Element) . |
AnimationScheduler.AnimationCallback, AnimationScheduler.AnimationHandle, AnimationScheduler.AnimationSupportDetector
Constructor and Description |
---|
StubAnimationScheduler() |
Modifier and Type | Method and Description |
---|---|
java.util.List<AnimationScheduler.AnimationCallback> |
getAnimationCallbacks()
Get the list of all animation callbacks that have been requested and have
not been canceled.
|
StubAnimationScheduler.StubAnimationHandle |
requestAnimationFrame(AnimationScheduler.AnimationCallback callback,
Element element)
Schedule an animation, letting the browser decide when to trigger the next
step in the animation.
|
get, requestAnimationFrame
public java.util.List<AnimationScheduler.AnimationCallback> getAnimationCallbacks()
public StubAnimationScheduler.StubAnimationHandle requestAnimationFrame(AnimationScheduler.AnimationCallback callback, Element element)
AnimationScheduler
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.
requestAnimationFrame
in class AnimationScheduler
callback
- the callback to fireelement
- the element being animated