[TIMOB-5459] iOS: Animation applied to a view is not properly transitioning when addEventListener is applied
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-06-15T18:49:24.000+0000 |
Affected Version/s | Release 1.8.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | addeventlistener, animate, ios, transition |
Reporter | Alan Vaghti |
Assignee | Ingo Muschenetz |
Created | 2011-10-06T11:46:58.000+0000 |
Updated | 2017-06-15T18:49:24.000+0000 |
Description
1) Add the following code to a new projects app.js
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var view = Titanium.UI.createView({
backgroundColor:'red'
});
var animation = Titanium.UI.createAnimation();
animation.backgroundColor = 'black';
animation.duration = 2000;
animation.addEventListener('complete',function()
{
animation.removeEventListener('complete',this);
animation.backgroundColor = 'orange';
view.animate(animation);
});
view.animate(animation);
win.add(view);
win.open();
2) Run the application
Expected result:
The view will animate from red to black to orange.
Actual results:
The view animates from red to black. It never transitions to orange.
Notes:
The code sample is from the following doc: http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Animation-object
Here is another example which is perhaps easier to see:
var win = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var view = Titanium.UI.createView({
backgroundColor:'white'
});
var animation = Titanium.UI.createAnimation();
animation.backgroundColor = 'red';
animation.duration = 4000;
animation.addEventListener('complete',function()
{
animation.removeEventListener('complete',this);
animation.backgroundColor = 'black';
view.animate(animation);
});
view.animate(animation);
win.add(view);
win.open();
Here the view should go from white to red to black, but only goes from white to red.
Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.