B4A Library ViewAnimations

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, Mar 27, 2016.

  1. DonManfred

    DonManfred Expert Licensed User

    This is a wrap for this Githubproject. I got inspired to do a wrap for this library here. I´m a rich man now; already ordered my own Island (Okok, just in my dreams :D)

    ViewAnimations
    Author:
    DonManfred (wrapper)
    Version: 1.26
    • AnimationComposer
      Methods:
      • Initialize (EventName As String, technique As Techniques)
      • Initialize2 (EventName As String, animator As BaseViewAnimator)
      • IsInitialized As Boolean
      • delay (delay As Long) As AnimationComposerWrapper
      • duration (duration As Long) As AnimationComposerWrapper
      • interpolate (interpolator As Interpolator) As AnimationComposerWrapper
      • onCancel (callback As AnimatorCallback) As AnimationComposerWrapper
      • onEnd (callback As AnimatorCallback) As AnimationComposerWrapper
      • onRepeat (callback As AnimatorCallback) As AnimationComposerWrapper
      • onStart (callback As AnimatorCallback) As AnimationComposerWrapper
      • playOn (target As View) As YoYoString
      • withListener (listener As AnimatorListener) As AnimationComposerWrapper
      Properties:
      • Techniques As Map [read only]

    This is a animation from the Github-project.
    It looks different than th example in b4a.

    [​IMG]
     

    Attached Files:

    Last edited: Dec 16, 2016
  2. ArminKH

    ArminKH Well-Known Member

    As always, this is awesome
     
    migrec likes this.
  3. somed3v3loper

    somed3v3loper Well-Known Member Licensed User

    We must have an auto like button for you guys wrapping and making libraries which is making B4A better and better :)
    Thanks a lot
     
    DonManfred, MarcoRome, Erel and 3 others like this.
  4. MarcoRome

    MarcoRome Expert Licensed User

    Again +10 ;)
    Thanks Don
     
    ArminKH likes this.
  5. susu

    susu Well-Known Member Licensed User

    Hi @DonManfred ,

    This lib worked great. But after add Appodeal SDK my app crash on Android 4.X.X (Android 5 and up seem ok).
    Here's error:

    Code:
    main_icon_click (java line: 882)
    java.lang.IllegalAccessError: Class ref 
    in pre-verified class resolved to unexpected implementation
        at com.daimajia.androidanimations.library.BaseViewAnimator.<init>(BaseViewAnimator.java:
    42)
        at com.daimajia.androidanimations.library.attention.RubberBandAnimator.<init>(RubberBandAnimator.java:
    32)
        at java.lang.Class.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:
    1319)
        at com.daimajia.androidanimations.library.Techniques.getAnimator(Techniques.java:
    179)
        at com.daimajia.androidanimations.library.YoYo$AnimationComposer.<init>(YoYo.java:
    91)
        at com.daimajia.androidanimations.library.YoYo$AnimationComposer.<init>(YoYo.java:
    80)
        at com.daimajia.androidanimations.library.YoYo.with(YoYo.java:
    58)
        at de.donmanfred.AnimationComposerWrapper.Initialize(AnimationComposerWrapper.java:
    41)
        at you.love.wallmaker.messi.main._bgicon_click(main.java:
    882)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    511)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    169)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    157)
        at anywheresoftware.b4a.BA.raiseEvent(BA.java:
    153)
        at anywheresoftware.b4a.objects.ViewWrapper$
    1.onClick(ViewWrapper.java:78)
        at android.view.View.performClick(
    View.java:4120)
        at android.view.View$PerformClick.run(
    View.java:17112)
        at android.os.Handler.handleCallback(Handler.java:
    615)
        at android.os.Handler.dispatchMessage(Handler.java:
    92)
        at android.os.Looper.loop(Looper.java:
    137)
        at android.app.ActivityThread.main(ActivityThread.java:
    4886)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    511)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    790)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    557)
        at dalvik.system.NativeStart.main(Native Method)
    Do you have any suggestions? Thanks.
     
  6. awakenblueheart

    awakenblueheart Member Licensed User

    This is good library!!! @DonManfred
    Btw,can someone teach me how to use these methods:
    • interpolate (interpolator As Interpolator) As AnimationComposerWrapper
    • onCancel (callback As AnimatorCallback) As AnimationComposerWrapper
    • onEnd (callback As AnimatorCallback) As AnimationComposerWrapper
    • onRepeat (callback As AnimatorCallback) As AnimationComposerWrapper
    • onStart (callback As AnimatorCallback) As AnimationComposerWrapper
    • withListener (listener As AnimatorListener) As AnimationComposerWrapper
     
  7. DonManfred

    DonManfred Expert Licensed User

    Not needed by your app. They are used ionside the library. Also interpolate.
    Will hide them in a future release....
     
    Peter Simpson likes this.
  8. awakenblueheart

    awakenblueheart Member Licensed User

    Ok.. I want to have method that check if this animation are starting, Then something happen.
    Include when animation done, then something else happen... :D

    p/s: I really need to learn how to make my own library...:(
     
  9. Embouk

    Embouk Member Licensed User

    How can i use this library to animate text as my app starts please. I've tried but can't seem to get it working.
     
  10. DonManfred

    DonManfred Expert Licensed User

    Show your code which you tried or better try it in a small example and upload the project... I suggest to have a look at the provided example and here in the item click event...
     
  11. MichalK73

    MichalK73 Active Member Licensed User

    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
    'Do not forget to load the layout file created with the visual designer. For example:
        'Activity.LoadLayout("Layout1")
        Activity.LoadLayout("form_main")
            techmap = anim.Techniques
        
    For i=0 To techmap.Size-1
            
    Log(i&" : "&techmap.GetValueAt(i))
        
    Next
        anim.Initialize(
    "motor",techmap.GetValueAt(19))
        anim.delay(
    500).duration(1500).playOn(Button1)
       
    End Sub
    With this code, as will be loaded layout, there is a button, then disappears and starts the animation of the position of the left button. How to do after loading the layout was buuton animation without the emergence of a moment this item?
     
  12. fredo

    fredo Active Member Licensed User

    As clients ask more for animations this is useful as it is very easy to handle.

    However, while trying to use
    Code:
    Sub anim_onanimationstart
        
    Log("#-anim_onanimationstart")
    End Sub

    Sub anim_onanimationend
        
    Log("#-anim_onanimationend")
    End Sub
    the following error is raised:

    16-12-_2016_12-21-52.jpg

    Would there be for me a possibility to find the correct signature by myself?

    (IDE "Sub [Tab]" doesn't offer suggestions)
     
  13. DonManfred

    DonManfred Expert Licensed User

    Try this version please
     

    Attached Files:

    Peter Simpson likes this.
  14. fredo

    fredo Active Member Licensed User

    Works.
    16-12-_2016_13-23-32.jpg
    Thank you for your fast response.


    Would it be possible to suppress the "Raising" log outputs?
    16-12-_2016_13-24-58.jpg
     
  15. DonManfred

    DonManfred Expert Licensed User

    here
     

    Attached Files:

  16. awakenblueheart

    awakenblueheart Member Licensed User

    Hi, I try to use the method onAnimationStart() but nothing happen... Please take a look on the attached project. Thanks!
     

    Attached Files:

  17. DonManfred

    DonManfred Expert Licensed User

    SURE! You defined Anim as Eventname but you are using vanim in your sub-signatures! This is a mistake!

    Code:
    Sub Anim_onAnimationStart()
        
    ToastMessageShow("tes",True)
        
    Log("startanimation")
    End Sub

    Sub Anim_onAnimationEnd()
        
    Log("endanimation")
    End Sub
     
    Peter Simpson likes this.
  18. awakenblueheart

    awakenblueheart Member Licensed User

    :D Haha my bad.. Thanks ya!!
     
  19. phukol

    phukol Active Member Licensed User

    Good day DonManfred!

    Im encountering this error when i try to make use of this library

    Code:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/nineoldandroids/
    animation/Animator$AnimatorListener;
        at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:
    122)
        at com.android.dx.dex.file.DexFile.add(DexFile.java:
    161)
        at com.android.dx.command.dexer.Main.processClass(Main.java:
    615)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
    570)
        at com.android.dx.command.dexer.Main.access$
    2(Main.java:546)
        at com.android.dx.command.dexer.Main$
    2.processFileBytes(Main.java:514)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:
    284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:
    166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:
    144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:
    537)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:
    449)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:
    236)
        at com.android.dx.command.dexer.Main.run(Main.java:
    206)
        at com.android.dx.command.dexer.Main.main(Main.java:
    179)
        at com.android.dx.command.Main.main(Main.java:
    103)
    1 error; aborting
     
  20. DonManfred

    DonManfred Expert Licensed User

    you are using another library which contains nineoldandroid too...
     
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