[AC-3019] View animate() not working with Ti.UI.createAnimation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2012-03-30T16:31:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | Pete Berry |
Assignee | Shak Hossain |
Created | 2012-03-12T12:49:09.000+0000 |
Updated | 2016-03-08T07:48:03.000+0000 |
Description
Using the example found in documentation for Titanium.UI.Animation we are unable to get the animate() function to work properly with Ti.UI.createAnimation
Ti.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({title:'Window'});
var box = Ti.UI.createView({
backgroundColor : 'red',
height : '100',
width : '100'
});
win.add(box);
win.open();
box.addEventListener('click', function() {
var matrix = Ti.UI.create2DMatrix()
matrix = matrix.rotate(180);
matrix = matrix.scale(2, 2);
var a = Ti.UI.createAnimation({
transform : matrix,
duration : 2000,
autoreverse : true,
repeat : 3
});
box.animate(a);
});
However if we create an object with using Ti.UI.createAnimation it works just fine!
Ti.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({title:'Window'});
var box = Ti.UI.createView({
backgroundColor : 'red',
height : '100',
width : '100'
});
win.add(box);
win.open();
box.addEventListener('click', function() {
var matrix = Ti.UI.create2DMatrix()
matrix = matrix.rotate(180);
matrix = matrix.scale(2, 2);
box.animate({
transform : matrix,
duration : 2000,
autoreverse : true,
repeat : 3
});
});
Not exactly the same as TIMOB-8461. This bug (TC-718) is about the animation not running. TIMOB-8461 is about the "completion" callback (of the animate method) not firing.