Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8461] iOS: View animate() not firing the CallBack with Ti.UI.createAnimation

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-07-15T11:52:05.000+0000
Affected Version/sRelease 2.0.0, Release 1.8.1, Release 1.8.2, Release 2.0.1
Fix Version/sRelease 3.1.0, 2013 Sprint 05 API, 2013 Sprint 05
ComponentsiOS
Labelsapi, insight, module_animation, qe-testadded
ReporterPete Berry
AssigneeVishal Duggal
Created2012-03-12T13:15:47.000+0000
Updated2013-11-13T01:41:22.000+0000

Description

Using the following example we are unable to get the animate() function to call the completion CallBack function. The bottom portion of the screen should slowly turn green then go black again.
Ti.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({title:'Window'});
var TheView=Ti.UI.createView({height:'100',
                              bottom:-100, 
                              backgroundColor:'green'});
win.add(TheView);

var RollUpObject=Ti.UI.createAnimation({bottom:1, duration: 2500});
var RollDownObject=Ti.UI.createAnimation({bottom:-100, duration: 2500});

win.open();
TheView.animate(RollUpObject, 
                function()
                {
                  TheView.animate(RollDownObject)
                });
However if we create an object without using Ti.UI.createAnimation it works just fine!
Ti.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({title:'Window'});
var TheView=Ti.UI.createView({height:'100',
                              bottom:-100, 
                              backgroundColor:'green'});
win.add(TheView);

var RollUpObject={bottom:1, duration: 2500};
var RollDownObject={bottom:-100, duration: 2500};

win.open();
TheView.animate(RollUpObject, 
                function()
                {
                  TheView.animate(RollDownObject)
                });

Comments

  1. Shawn Lipscomb 2012-03-30

    Not exactly the same as TC-718. This bug (TIMOB-8461) is about the "completion" callback (of the animate method) not firing. TC-718 is about the animation not running.
  2. Junaid Younus 2012-05-21

    Tested with 2.0.1GA2, issue still exists on a Samsung Galaxy S2 (2.3.6). I also tried it on the iOS simulator, when you use a Ti.UI.Animation object, the green view doesn't seem to move back down. If you don't use a Ti.UI.Animation object, it moves back down just fine.
  3. Mitchell Amihod 2012-11-22

    In my case (Android), I found as long as the item was onscreen (even if not visible - hidden behind another element) then animation complete fires as usual. But if trying to position element totally offscreen, then you get the weird case of animation complete not firing until some sort of user interaction happens. I should stress this does NOT happen in the emulator - only on device.
  4. Vishal Duggal 2013-03-01

    This was fixed on Android as part of TIMOB-6227
  5. Vishal Duggal 2013-03-01

    Pull pending https://github.com/appcelerator/titanium_mobile/pull/3923
  6. Sabil Rahim 2013-03-12

    CR & FR
  7. Paras Mishra 2013-03-14

    Ti.UI.createAnimation is getting fired and working fine on iOS 6 Verified on: Device : iPad mini, iOS version: 6 SDK version: 3.1.0.v20130313215655 CLI version : 3.0.24 OS : MAC OSX 10.7.5 XCode : 4.5.1
  8. Priya Agarwal 2013-07-15

    Reopening just to update label.
  9. Priya Agarwal 2013-07-15

    Updated Label and Verified with: Titanium Studio:3.1.2.201307091843 Titanium SDK: 3.1.2.v20130710144553 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1 OS: OSX 10.8 Device:iPhone simulator(v 6.0), Iphone4(v 5.1), Galaxy Nexus(V 4.0.4) Xcode: 4.5.1 View animate() firing the CallBack with Ti.UI.createAnimation
  10. Danny Pham 2013-11-13

    I have just noticed that the bug Mitchell is reporting "... but if trying to position element totally offscreen, then you get the weird case of animation complete not firing until some sort of user interaction happens ..." still occurrs in SDK 3.13 on real device only. Any bugfix for this?

JSON Source