B4A Library NineOldAndroids

Discussion in 'Additional libraries, classes and official updates' started by Informatix, Sep 3, 2014.

  1. Informatix

    Informatix Expert Licensed User

    This is my version of the NineOldAndroids lib for B4A. It's free and provided with the Java source code.

    This library offers more possibilities of animation than AnimationPlus (rotation or translation on more than one axis for 3D effect, animation step by step with events for each step, synchronization between animations, ability to change the view size and contents during the animation, etc.).

    It works with all versions of Android >= 2 and with all views, even custom ones.

    v0.92: Initial release.
    v0.92b: I changed the package name and repackaged the source to ease its compilation.
    v0.93: I fixed a bug in noaObjectAnimator.InitializeFloat.
     

    Attached Files:

    Last edited: Sep 21, 2015
    fredo, Levit, Multiverse app and 33 others like this.
  2. eps

    eps Well-Known Member Licensed User

    Wow! This could be really useful for something I've been trying to work out how to do...

    Thanks for sharing
     
  3. sorex

    sorex Expert Licensed User

    thanks, Informatix.
     
  4. JohnD

    JohnD Active Member Licensed User

    I really appreciate you including the Java src.
     
  5. dealsmonkey

    dealsmonkey Active Member Licensed User

    Than you :)
     
  6. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Hi Informatix,
    First of all thank you for this library, it is my 'go to' library for any animation as it is very easy to use and can do pretty much everything. Also the handling is easier as the view property actually changes.

    However, I am having some problem, possibly due to the way you wrote this library.
    Basically I have a couple of other libraries that depend on the NineOldAndroid jar. They use DependsOn to refer to the actual external jar (NineOldAndroid-2.4.0.jar).
    Your library however packages the source inside your jar.
    If I include both of these libraries in a project, it creates duplicate classes in the app and the dexer fails. (I think this is the step where jar is converted to dex).
    If I remove the DependsOn annotation then my library cannot find the method from the NineOldAndroids package.
    The only way I see around (maybe you have an alternate solution) it is to re-write the NineOldAndroids as a wrapper which ofcourse is a lot more work.
     
  7. Informatix

    Informatix Expert Licensed User

    NineOldAndroids needs only one jar: NineOldAndroids.jar. I don't distribute the NineOldAndroid-2.4.0.jar (you probably downloaded and installed it yourself from the Wharton's web site) and it is not needed. The original source is in the zip file, not in a jar, and is just there for license reasons. You can let it in the zip file.
    I cannot just write a wrapper for this library. If you make a diff between the two source codes, you'll see big differences. I changed many things.
     
  8. thedesolatesoul

    thedesolatesoul Expert Licensed User

    You are correct. It is not needed to use your library, but I downloaded to use some other libraries that depend on the Jake's jar.

    Ok, I didnt really go that deep into the source.

    Anyway, I cannot get it to work with other libs that also depend on this jar when I include your library.

    - When adding both libraries, adds duplicate source
    - If I modify my wrapper to depend on your jar, I still get:
    Code:
    java.lang.NoSuchMethodError: com.nineoldandroids.animation.ObjectAnimator.setInterpolator
     
  9. Informatix

    Informatix Expert Licensed User

    As you have my source code, why don't you change the package name of my library in Eclipse? So you will create a distinct library from the original one.
     
  10. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Ok, I can do that if you like.
     
  11. Informatix

    Informatix Expert Licensed User

    It's not "if I like". If you want to solve your problem, you have to find a solution and, from my point of view, it's the simplest one. Your problem is specific to your case. Other users of this library don't have it, so I don't see what I could do on my side.
     
  12. thedesolatesoul

    thedesolatesoul Expert Licensed User

    By this I meant I have your permission.

    I know, but if I decide to release the library then other users will have the same problem.
    There is another issue that refreshing the library tab/clean project doesnt always work sometimes I have to restart the IDE.

    I will see if I can find an alternative, otherwise I will change the packagename.
     
  13. Informatix

    Informatix Expert Licensed User

    Ok, don't worry. I will change the package name tonight and release a new version.
     
  14. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Thank you
     
  15. Informatix

    Informatix Expert Licensed User

    Done. See post #1.
     
  16. thedesolatesoul

    thedesolatesoul Expert Licensed User

    NJDude likes this.
  17. Filippo

    Filippo Expert Licensed User

    Hi Informatix,

    I have a problem if I use your library.
    After the animation of a panel I can not move properly the panel.
    Please Try my project.
     

    Attached Files:

  18. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Did you try
    AnimRotatY2.InitializeFloat(pnlWithAnimation, AnimRotatY2.PROPERTY_ROTATION_Y, 0, 90, "AnimRotatY2")
     
  19. Filippo

    Filippo Expert Licensed User

    Hi thedesolatesoul,

    what can be wrong here?
    Sub setWithAnimation
    AnimRotatY1.InitializeFloat(pnlWithAnimation, AnimRotatY1.PROPERTY_ROTATION_Y, 0, 90, "AnimRotatY1")
    AnimRotatY1.RepeatCount = 0
    AnimRotatY1.Start
    End Sub

    Sub AnimRotatY1_End
    Dim ImageEffects As RSImageEffects
    Dim bmp As Bitmap
    bmp.Initialize3(LoadBitmapSample(File.DirAssets, "image.jpg", pnlWithAnimation.Width, pnlWithAnimation.Height))
    pnlWithAnimation.SetBackgroundImage(ImageEffects.Mirror(bmp))
    AnimRotatY2.InitializeFloat(pnlWithAnimation, AnimRotatY2.PROPERTY_ROTATION_Y, 0, 90, "AnimRotatY2")
    AnimRotatY2.RepeatCount = 0
    AnimRotatY2.Start
    End Sub

    Sub AnimRotatY2_End
    pnlWithAnimation.SetBackgroundImage(LoadBitmapSample(File.DirAssets, "image.jpg", pnlWithAnimation.Width, pnlWithAnimation.Height))
    End Sub
     
  20. thedesolatesoul

    thedesolatesoul Expert Licensed User

    I dont know what the wrong behaviour is.
    At the moment i cannot connect my device to pc, some driver issues, so i cannot check the output.
     
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