Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5459] iOS: Animation applied to a view is not properly transitioning when addEventListener is applied

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-15T18:49:24.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sn/a
ComponentsiOS
Labelsaddeventlistener, animate, ios, transition
ReporterAlan Vaghti
AssigneeIngo Muschenetz
Created2011-10-06T11:46:58.000+0000
Updated2017-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.

Comments

  1. Lee Morris 2017-06-15

    Closing ticket due to time passed and lack of progress in the past few years. Any problems, please file a new ticket.

JSON Source