[TIMOB-19984] Android: transform animation doesn't work immediately after creating a view [android]
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-12-06T01:31:22.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | Community, TCSupportTriage, android, animation, qe-6.1.0, transform |
Reporter | grebulon |
Assignee | Gary Mathews |
Created | 2014-12-30T11:37:15.000+0000 |
Updated | 2016-12-08T19:10:35.000+0000 |
Description
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.
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();
This bug is very annoying? I don't understand how you keep delaying it again and again. It's been over a year!
High priority bug, reported 30/Dec/14 (Titanium 3.4.1)
master: https://github.com/appcelerator/titanium_mobile/pull/8642
Verified as fixed adding an animation to run immediately after creation works as expected. Tested on: {noformat} macOS Sierra 10.12.1 Nexus 5X(6.0.1) Nexus 6p (7.0) android emulator (4.4.2, 6.0) Ti SDK: 6.1.0.v20161207121046 Appc NPM: 4.2.8 App CLI: 6.1.0-309 Node v4.4.7 {noformat} *Closing Ticket.*