I want to slide the current open window to the left, and slide a new window from the right to on screen. I use the following code, which does the job:
var newWindow = Titanium.UI.createWindow({
url:'new.js',
backgroundImage:'ui/bg.gif',
zIndex: 10,
left: "100%",
width: "100%"
});
var slide_it_left = Titanium.UI.createAnimation();
slide_it_left.left = 0; // to put it back to the left side of the window
//slide_it_left.curve = Titanium.UI.ANIMATION_CURVE_LINEAR;
slide_it_left.duration = 500;
var slide_it_right = Titanium.UI.createAnimation();
slide_it_right.left = "-100%";
//slide_it_right.curve = Titanium.UI.ANIMATION_CURVE_LINEAR;
slide_it_right.duration = 500;
currentWindow.animate(slide_it_right);
newWindow.open(slide_it_left);
However, there seems that there is a space of 20px between the two windows when they slide in/out. I have no idea how that is possible, since the currentWindow has a width of 100% and the new one as well.. I tried to hide that black space, by adjusting curve/ease, but with no good result, you still can notice a black space in between them no matter what. Any ideas? Thanks!
UPDATE: By making the animation duration super slow, I noticed that at the beginning and at the end they are perfectly aligned, but in between they are not. By making the animation to be very fast, the space between the two windows are big. Which means there must be something going on with the easing.. This should make the animation go without easing, no?: "Titanium.UI.ANIMATION_CURVE_LINEAR". But somehow it does not solve the problem.. Have no idea where the easing comes from.