Titanium JIRA Archive
Appcelerator Community (AC)

[AC-1808] Start and complete event for animation are not working

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionHold
Resolution Date2013-03-15T18:19:20.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsanimation, event, ios, triage
ReporterElmar Maan
AssigneeShak Hossain
Created2013-01-25T10:17:06.000+0000
Updated2016-03-08T07:40:42.000+0000

Description

When you add the start and the complete event to an animation, both of these events are not fired!

Comments

  1. Varun Joshi 2013-01-25

    Hi Elmar, Please provide more details: 1. A simple reproducible test case (app.js) 2. Your system details i.e Mac OS version, Titanium Studio version. Thanks.
  2. Craig Jones 2013-01-28

    Apologies for jumping in, I took the following snippet from an old project I was updating and found the same issue. Just trying to action a function (alert in the demo below) after an animation has completed. Snow Leopard, iOS6, SDK3.0.0
       //Page intro copy to fade in
       var pageIntro = Ti.UI.createLabel({
           text: "Some intro copy...",
           font: {fontSize: 15, fontFamily: "Verdana"},
           color: '#000',
           width: 192,
           height: 70,
           top: 55,
           textAlign: 'center',
           opacity: 0
       }),
           pageIntroAnimation = Titanium.UI.createAnimation({
               curve:Ti.UI.ANIMATION_CURVE_EASE_IN,
               opacity:1,
               duration:800
           });
           
       win.add(pageIntro);
           
       //Page intro copy fades in ok
       pageIntro.animate(pageIntroAnimation);
          
       pageIntroAnimation.addEventListener('complete', function(){
           //Not getting in here to action a function/alert
           alert("Animation complete");
       });//complete
       
  3. Eric Merriman 2013-02-04

    Unable to reproduce using this code and 3.0.0.GA in the simulator:
       
       var sampleSetWindow = Ti.UI.createWindow({
       });
        
       var submitSampleButton = Ti.UI.createButton({
           title: "Click to animate",
           top: 20
       });
        
       submitSampleButton.addEventListener("click", function(e){
               sampleSetWindow.animate(closeAnimation);
       });
        
       var closeAnimation = Ti.UI.createAnimation({
           duration: 800,
           right: Ti.Platform.displayCaps.getPlatformWidth(),
           left: -Ti.Platform.displayCaps.getPlatformWidth(),
       });
       
       closeAnimation.addEventListener("start", function(e){
       	Ti.API.info("Animation start");
       });
       
       closeAnimation.addEventListener("complete", function(e){
          Ti.API.info("Animation complete");
       });
       
       sampleSetWindow.add(submitSampleButton);
       sampleSetWindow.open();
       
    Also tried Craig's code, with the addition of the var "win" to get it to work. Was unable to reproduce with 3.0.0.GA in simulator. Will try device. To all, please provide additional info, such as iOS version, Xcode version, Mac OS version, CLI version ("ti -v" in terminal) and studio version.
  4. Eric Merriman 2013-02-04

    Both examples work on device built with SDK 3.0.0.GA. Will revisit if we can get more info.
  5. Eric Merriman 2013-02-07

    The code sample on its own works for Craig, but not in his app, created possibly circa 2.1.3. His app works when 2.1.3 is selected. He upgraded to Xcode 4.6 and no change. He discovered this work around for his issue and will provide more detail when he has time.
       pageIntro.animate({
                   curve:Ti.UI.ANIMATION_CURVE_EASE_IN,
                   opacity:1,
                   duration:800
               }, function(evt) {
                   //run function
                   alert("Animation Complete!");
               });
       
  6. Ingo Muschenetz 2013-03-15

    Will reopen when we get more information.

JSON Source