[TIMOB-8461] iOS: View animate() not firing the CallBack with Ti.UI.createAnimation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-07-15T11:52:05.000+0000 |
Affected Version/s | Release 2.0.0, Release 1.8.1, Release 1.8.2, Release 2.0.1 |
Fix Version/s | Release 3.1.0, 2013 Sprint 05 API, 2013 Sprint 05 |
Components | iOS |
Labels | api, insight, module_animation, qe-testadded |
Reporter | Pete Berry |
Assignee | Vishal Duggal |
Created | 2012-03-12T13:15:47.000+0000 |
Updated | 2013-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)
});
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.
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.
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.
This was fixed on Android as part of TIMOB-6227
Pull pending https://github.com/appcelerator/titanium_mobile/pull/3923
CR & FR
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
Reopening just to update label.
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
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?