http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/Animation.gwt.xml
File user/src/com/google/gwt/animation/Animation.gwt.xml (right):
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/Animation.gwt.xml#newcode25
user/src/com/google/gwt/animation/Animation.gwt.xml:25:
<property-provider name="animationTimingSupport"><![CDATA[
You're right. I missed the collapse-property in my review.
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/Animation.gwt.xml#newcode37
user/src/com/google/gwt/animation/Animation.gwt.xml:37:
<when-property-is name="user.agent" value="ie6" />
Does this need to be wrapped in <any>?
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/Animation.gwt.xml#newcode48
user/src/com/google/gwt/animation/Animation.gwt.xml:48:
<when-property-is name="animationTimingSupport" value="moz" />
Adding the line would work, and wrap with an <any> tag.
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java
File
user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java
(right):
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java#newcode45
user/src/com/google/gwt/animation/client/AnimationImplMozAnimTiming.java:45:
if (!complete) {
On 2011/03/03 20:59:06, tbroyer wrote:
On 2011/03/03 19:26:22, jlabanca wrote:
> If you check !cancelled here, it could result in a bad state if the
Animation
is
> restarted synchronously.
What would you propose?
Would it also be an issue if 'cancelled' is checked before update() is
called
(which should have been the case)
We probably need some kind of handle like webkit uses. You could wrap
callback in an object and assign a static ID. Then, check the ID when
the callback is invoked.
private static int curId;
public void cancel() {
curId++;
}
public void run(Animation animation, Element element) {
curId++;
nativeRun(animation, curId);
}
private native void nativeRun(Animation animation, double id) /*-{
var self = this;
var handle = id;
var callback = $entry(function(time) {
if (handle !=
[email protected]::curId)
{
return; // canceled.
}
});
/*-}
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/client/AnimationImplTimer.java
File user/src/com/google/gwt/animation/client/AnimationImplTimer.java
(right):
http://gwt-code-reviews.appspot.com/1355805/diff/3003/user/src/com/google/gwt/animation/client/AnimationImplTimer.java#newcode83
user/src/com/google/gwt/animation/client/AnimationImplTimer.java:83:
Scheduler.get().scheduleFixedDelay(animationCommand,
DEFAULT_FRAME_DELAY);
On 2011/03/03 20:59:06, tbroyer wrote:
On 2011/03/03 19:26:22, jlabanca wrote:
> If the animation runs slowly, we may end up animating with only 1ms
intervals
in
> between, which would make the UI unresponsive. Can you use a
ScheduledCommand
> instead of a RepeatingCommand, and reschedule manually with a delay?
This is what scheduleFixedDelay does (contrary to
scheduleFixedPeriod):
http://google-web-toolkit.googlecode.com/svn/javadoc/2.2/com/google/gwt/core/client/Scheduler.html#scheduleFixedDelay%28com.google.gwt.core.client.Scheduler.RepeatingCommand,
int)
You were probably thinking about the old, deprecated
DeferredCommand/IncrementalCommand.
> Also, note that in the current implementation, this animationCommand
will
never
> stop executing in the background.
Er, wouldn't it stop when all animations complete? (animations would
then be
empty and the animationCommand would then return false, which would
terminate
the "loop")
You're correct all around. I didn't realize how scheduledFixedDelay
works.
http://gwt-code-reviews.appspot.com/1355805/
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors