[TIMOB-16860] Android: Animate with Matrix with concatenating same operation multiple times doesn't use property animation
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | 2DMatrix, SupportTeam, alloy, android, animate, transform |
Reporter | Sunila |
Assignee | Unknown |
Created | 2014-04-17T17:49:19.000+0000 |
Updated | 2018-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();
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
will it be fixed in the 3.4 sdk ?
[~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.