Andriod Animation problem

You must Login before you can answer or comment on any questions.

Hi Titaniums .. i use the example of animation to move box from point to point in my andriod application BUT the box move in wrong direction and after end the animate box back to right position that should move to in first place ..!!!! any idea !!

var view = Titanium.UI.createView({
    backgroundColor : 'red',
    width : 50,
    height : 50,
    left : 300,
    bottom : 10,
});
 
var animation = Titanium.UI.createAnimation();
animation.left = 700;
animation.bottom = 200;
animation.duration = 1000;
 
Titanium.UI.currentWindow.add(view);
 
view.animate(animation);

2 Answers

When you set the animation to left = 700, the animation will move to that point on the screen, not move that direction. So moving a box from left 300 to left 700 will mean that the box actually moves to the right.

— answered 2 years ago by Anthony Decena
answer permalink
3 Comments
  • sorry but i meant to do that the problem is the box move right to more than 700 and then get back to 700 ..

    — commented 2 years ago by Khaled Kofahi

  • How big is your screen where you can actually see this happening? 700 seems like it would be off the edge of the screen. Also, you need to share all the info about your dev env. I tested this with 2.3.3 Android and 2.1.4.GA sdk with some smaller values and everything seemed to work ok.

    — commented 2 years ago by Anthony Decena

  • the dimension for my screen is (1280 X 726) and the sdk is 4.2 i do create 3 views one in the start position,one in the final destination and the third one is animated to move from start to end ... its moves in wrong path then back to final destination

    — commented 2 years ago by Khaled Kofahi

the dimension for my screen is (1280 X 726) and the sdk is 4.2 i do create 3 views one in the start position,one in the final destination and the third one is animated to move from start to end ... its moves in wrong path then back to final destination

Your Answer

Think you can help? Login to answer this question!