Problem Description
The animation in the code will suddenly stop if running with 3.2.3.GA/3.3.0.RC. If you are using 3.2.2.GA, will continue without any issue. See the video attached.
Note, that I has not managed to recreate the issue on the GT-S7562 device. At the same time the issue can be easily recreated on the AVD.
<Alloy>
<Window class="container">
<View borderWidth="1" borderColor="black" width="30" height="Titanium.UI.FILL"></View>
<View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="30"></View>
<View borderWidth="1" borderColor="black" width="60" height="Titanium.UI.FILL"></View>
<View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="60"></View>
<View borderWidth="1" borderColor="black" width="90" height="Titanium.UI.FILL"></View>
<View borderWidth="1" borderColor="black" width="Titanium.UI.FILL" height="90"></View>
</Window>
</Alloy>
var view = Ti.UI.createView({
backgroundColor: 'green',
opacity: 1,
width: 30,
height: 30,
});
var baseX, baseY;
var onPostLayout = function() {
baseX = view.rect.x;
baseY = view.rect.y;
Ti.API.info('postlayout: ' + baseX + ", " + baseY);
startAnimation();
view.removeEventListener('postlayout', onPostLayout);
};
view.addEventListener('postlayout', onPostLayout);
var animation = Ti.UI.createAnimation();
animation.addEventListener('complete', function() {
Ti.API.info('Animation complete');
startAnimation();
});
var shiftX = 15;
var shiftY = 15;
function startAnimation() {
shiftX = -shiftX;
shiftY = -shiftY;
animation.left = baseX + shiftX;
animation.top = baseY + shiftY;
animation.duration = 2000;
Ti.API.info('Start Animation: ' + JSON.stringify(animation));
view.animate(animation);
};
$.index.add(view);
$.index.open();
I tried to reproduce the issue with Titanium SDK 3.2.3 GA on Samsung Galaxy device and was not able to reproduce it. I don't see any difference in the animation with Titanium SDK 3.2.2 GA and 3.2.3 GA. Can you please try it on some other devices as this will help us narrow down the issue?
Hello! I tested this on Mobile SDK 3.2.3.GA on a Motorola X with Android 4.4.2 and it's working just fine. Can you please provide more info? When the animation stops working in your testing? Best, Mauro
Hi Mauro, have you seen the video attached? Seems, the easiest way to recreate the issue is to use x86 AVD and the code provided. I've just recreated it on Nexus_10_by_Google, Android 4.4.2/19, Intel Atom (x86) AVD
Cannot reproduce Titanium SDK version 3.4.0 master, 3.3.0.GA, 3.2.3.GA, 3.2.2.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android emulator , Android version : 2.3.3
[~jithinv@exalture.com] can you please try the EXACT AVD as specified in the line above: Nexus_10_by_Google, Android 4.4.2/19, Intel Atom (x86) AVD
Sorry, we are unable to test with the specified AVD.
I've just made some more tests... Seems the issue only occurs with "Use host GPU" turned 'on'. This time I used the 2.3.3 Android version and was able to recreate the issue.