Project: titanium
Issue TIMOB-19984: Android: transform animation doesn't work immediately after creating a view [android]
1. Create a view with an initial transform (it is important that an initial transform matrix is set) 2. Add the view 3. Call animate The animation will not work and the animation callback is not executed. Notes: 1. This problem is specific to *transform* animation. If the view is animated with left/right/top/bottom for example, everything works fine. 2. Deferring the animation, for example by putting it in a setTimeout callback, works if the timeout is long enough. *Sample code* - run this, click the button and view the result. {code} var window=Ti.UI.createWindow({backgroundColor:'white'}); mainView=Ti.UI.createView({backgroundColor:'white'}); window.add(mainView); button=Ti.UI.createButton({left:0,right:0,height:40,bottom:0,title:'start'}); button.addEventListener('click',function(e) { Ti.API.info("********** start **********") var view=Ti.UI.createView({backgroundColor:'red',left:40,right:0,top:0,bottom:40,transform:Ti.UI.create2DMatrix().scale(0.1)}); mainView.add(view); view.animate({left:0,transform:Ti.UI.create2DMatrix().scale(1),duration:500},function() { Ti.API.info("********** end **********") mainView.remove(view); view=null; }); }); mainView.add(button); window.open(); {code}
Story points: 8