Problem description
Animating an imageView on Android with a rotation. Each time the imageView animation is triggered, it starts over from 0 instead of going on from the last position.
On iOS it works continually as expected.
Sample code (imageView file in attachment)
var win = Ti.UI.createWindow({
backgroundColor : 'gray'
});
var iv = Ti.UI.createImageView({
image : '/images/circ.png',
top : 100 - 480
});
var gTrans = Ti.UI.create2DMatrix();
win.add(iv);
var btn = Ti.UI.createButton({
title : 'amin it',
top : 400
});
btn.addEventListener('click', function() {
gTrans = gTrans.rotate(20);
var a = Ti.UI.createAnimation({
duration : 1000
});
a.transform = gTrans;
iv.animate(a);
});
win.add(btn);
win.open();
Customer ticket
http://support-admin.appcelerator.com/display/APP-563796
Refer to Android platform notes in http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.Animation-object and http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.2DMatrix.rotate-method-1.html Android supports 2D matrix transformations. Note that the 2DMatrix.rotate method operates differently on Android. Called with a single argument, it rotates from zero to the specified angle. That is, it ignores any existing rotation. Called with two arguments, it interprets the first argument as a "from" angle and the second argument as a "to" angle.