AnimationSchedulerImpl abstract class
Base class for animation implementations.
abstract class AnimationSchedulerImpl extends AnimationScheduler { static AnimationSchedulerImpl impl; factory AnimationSchedulerImpl.Instance() { impl = new AnimationSchedulerImpl.browserDependent(); /* * If the implementation isn't natively supported, revert back to the timer * based implementation. * * If impl==null (such as with GWTMockUitlities.disarm()), use null. We * don't want to create a new AnimationSchedulerImplTimer in this case. */ if (impl is AnimationSchedulerImpl) { if (!impl.isNativelySupported()) { impl = new AnimationSchedulerImplTimer(); } } return impl; } AnimationSchedulerImpl(); factory AnimationSchedulerImpl.browserDependent() { return new AnimationSchedulerImplWebkit(); } /** * Check if the implementation is natively supported. * * @return true if natively supported, false if not */ bool isNativelySupported(); }
Extends
AnimationScheduler > AnimationSchedulerImpl
Subclasses
AnimationSchedulerImplTimer, AnimationSchedulerImplWebkit
Static Properties
AnimationSchedulerImpl impl #
static AnimationSchedulerImpl impl
Constructors
new AnimationSchedulerImpl() #
factory AnimationSchedulerImpl.browserDependent() #
factory AnimationSchedulerImpl.browserDependent() { return new AnimationSchedulerImplWebkit(); }
factory AnimationSchedulerImpl.Instance() #
Returns the default implementation of the AnimationScheduler API.
factory AnimationSchedulerImpl.Instance() { impl = new AnimationSchedulerImpl.browserDependent(); /* * If the implementation isn't natively supported, revert back to the timer * based implementation. * * If impl==null (such as with GWTMockUitlities.disarm()), use null. We * don't want to create a new AnimationSchedulerImplTimer in this case. */ if (impl is AnimationSchedulerImpl) { if (!impl.isNativelySupported()) { impl = new AnimationSchedulerImplTimer(); } } return impl; }
Methods
abstract bool isNativelySupported() #
Check if the implementation is natively supported.
@return true if natively supported, false if not
abstract AnimationHandle requestAnimationFrame(AnimationCallback callback, [Element element = null]) #
Schedule an animation, letting the browser decide when to trigger the next step in the animation.
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.
@param callback the callback to fire @return a handle to the requested animation frame @param element the element being animated