Android Question Animation does not stay when finished

Thraka

Member
Licensed User
Longtime User
I'm trying to use the Animation class to move a view on the screen. It works, I see the view move to the desired position but after the animation has finished, the view returns to its original position.

B4X:
Dim ani As Animation
ani.InitializeTranslate("", 0, 0, 400dip, 0)
ani.Duration = 200
ani.Start(myView)
 

Troberg

Well-Known Member
Licensed User
Longtime User
I have seen that happen as well. I thought it was a bug in my code, but I haven't got around to fixing it yet. Perhaps, I now see, it's not.

It doesn't happen on all devices, and it doesn't happen all the time (in my case, it only happens when I don't have a video playing, which is what led me to believe that it was me that had effed up).
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I'm trying to use the Animation class to move a view on the screen. It works, I see the view move to the desired position but after the animation has finished, the view returns to its original position.

B4X:
Dim ani As Animation
ani.InitializeTranslate("", 0, 0, 400dip, 0)
ani.Duration = 200
ani.Start(myView)
In fact, the Animation lib does not move the view, it just moves an image of this view. That's why the view is still at the same place when the animation ends. You can use the AnimationPlus lib with PersistAfter = true or, much better, you can use the NineOldAndroids lib which really moves the view.
 
Upvote 0
Top