Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3019] View animate() not working with Ti.UI.createAnimation

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2012-03-30T16:31:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid
ReporterPete Berry
AssigneeShak Hossain
Created2012-03-12T12:49:09.000+0000
Updated2016-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
        });
});

Comments

  1. Shawn Lipscomb 2012-03-30

    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.

JSON Source