Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16860] Android: Animate with Matrix with concatenating same operation multiple times doesn't use property animation

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labels2DMatrix, SupportTeam, alloy, android, animate, transform
ReporterSunila
AssigneeUnknown
Created2014-04-17T17:49:19.000+0000
Updated2018-02-28T20:04:26.000+0000

Description

Run the below code and you will see that the label position is changed properly when 'btTestAnimate' is clicked.
var win = Ti.UI.createWindow({
backgroundColor:'white',
});

var coords = Ti.UI.createLabel({ text:'coords' });

win.add(coords);

var btTranslate = Ti.UI.createButton({top:100,title:"btTranslate"});
win.add(btTranslate);

var btTestAnimate = Ti.UI.createButton({top:200,title:"btTestAnimate"});
win.add(btTestAnimate);

var t1 = Titanium.UI.create2DMatrix();
btTranslate.addEventListener("click",function(e){ t1 = t1.translate(50,0); coords.transform = t1; });

btTestAnimate.addEventListener("click",function(e){
t1 = t1.translate(50,0);
coords.animate({transform : t1,duration:1000});
});

win.open();
But if the matrix is concatenated, it doesn't use the propery animation is not used and the result is not persisted which causes the label to flicker. Run the below code to see the behaviour
var win = Ti.UI.createWindow({
    backgroundColor:'white',
});

var coords = Ti.UI.createLabel({
    text:'coords'
    });

win.add(coords);

var btTranslate = Ti.UI.createButton({top:100,title:"btTranslate"});
win.add(btTranslate);

var btTestAnimate = Ti.UI.createButton({top:200,title:"btTestAnimate"});
win.add(btTestAnimate);

var t1;
var i = 1;
btTranslate.addEventListener("click",function(e){ t1 = Titanium.UI.create2DMatrix();t1 = t1.translate(i*50,0); coords.transform = t1; i++});

btTestAnimate.addEventListener("click",function(e){
    t1 = Titanium.UI.create2DMatrix();t1 = t1.translate(i*50,0);i++;
coords.animate({transform : t1,duration:1000});
});

win.open();

Comments

  1. jithinpv 2014-08-29

    Issue reproduces Titanium SDK version 3.4.0 master, 3.3.0.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
  2. hamza ezzi 2014-09-24

    will it be fixed in the 3.4 sdk ?
  3. Ingo Muschenetz 2014-09-24

    [~hamzaezzi] Apologies, it is unlikely. Perhaps in a future version. If you can get more people to "watch " the ticket, that might influence how fast it is fixed.

JSON Source