Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-6612

iOS: Animation override not working correctly

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Component/s: Titanium SDK & CLI
    • Labels:
    • Environment:

      iOS using Ti SDK 9.2.0

      Description

      Overriding an animation on iOS sometimes does not work correctly. The following example, when tapping the window, should show a black view moving from left to right.

      When reaching about the middle of the screen, another animation should override the first and move the view back again.

      On Android it works as expected, on iOS the view pauses, jumps to the right side of the screen, animates a smal distance and finally jumps back to the left side of the screen.

      const win=Ti.UI.createWindow({
      	backgroundColor:'white'
      });
       
      const view=Ti.UI.createView({
      	left:0,
      	width:100,
      	height:100,
      	backgroundColor:'black',
      	overrideCurrentAnimation:true //this is for Android
      });
      win.add(view); 
       
      const animate=(forward,duration)=>{
      	view.animate({
      		left:forward ? win.size.width-view.size.width : 0,
      		curve:Ti.UI.ANIMATION_CURVE_LINEAR,
      		duration:duration	
      	});
      };
        
      const button=Ti.UI.createButton({
      	title:'Start',
      	bottom:100
      });
      button.addEventListener('click',()=>{
      	animate(true,2000); //animate the view from left to right with a duration of 2000 ms...
      	setTimeout(()=>animate(false,2000),1000); //... but after 1000 ms we override to animate back again
      });
      win.add(button); 
       
      win.open();
      

        Attachments

          Activity

            People

            • Assignee:
              amukherjee Abir Mukherjee
              Reporter:
              mj martin
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Git Integration