Android Question Simple animation movement

Shay

Well-Known Member
Licensed User
Longtime User
Hi
How do I move on screen Imageview from location A to location B
(and then from B to C, etc)
but I wish to do it on absolute location, meaining
if ImageView is left 50, top 100, then to move it to left 20, top 200
I tried animation library, but I can't move it to my location
 

Cableguy

Expert
Licensed User
Longtime User
I tried animation library, but I can't move it to my location
Can you post your code using animation lib?
What works/what doesn't work with the animation lib?
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Nice, but if I need also to move the top on the same time?

Cableguy, basically I wish to move from point a,b to point c,d and stay there, and then move from c,d to e,f (but by top, left)
I will give it another try..
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
B4X:
 ImageView1.Left=0
For i= ImageView1.Left To 400dip Step 2 '
        ImageView1.Left=i
        Sleep(0)
    Next
It is better to use: ImageView1.SetLayoutAninated(duration,left,top,width,height)
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Nice, but if I need also to move the top on the same time?

Cableguy, basically I wish to move from point a,b to point c,d and stay there, and then move from c,d to e,f (but by top, left)
I will give it another try..
Use SetLayoutAninated for the 4 movements, between a movement and another read one sleep(Duration)
So you will have the movement you want
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Thanks everyone, I found the solution,
I am doing calculation between the points (starting from 0,0)
and then using:
Sub Animation_AnimationEnd
and putting the "end" location for my imageview
this is moving the image and let it stay there..
 
Upvote 0
Top