Android Question Animation does not stay when finished

Discussion in 'Android Questions' started by Thraka, Feb 23, 2015.

  1. Thraka

    Thraka Member Licensed 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.

    Code:
    Dim ani As Animation
    ani.InitializeTranslate(
    ""00400dip0)
    ani.Duration = 
    200
    ani.Start(myView)
     
  2. Troberg

    Troberg Well-Known Member Licensed 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).
     
  3. Informatix

    Informatix Expert Licensed User

    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.
     
    thedesolatesoul likes this.
  4. Troberg

    Troberg Well-Known Member Licensed User

    I withdraw my previous comment. I'm not using the animation lib, I'm using the feature which came with B4A 4.0.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. Thraka

    Thraka Member Licensed User

    Thanks
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice