ViewAnimations

DonManfred

Expert
Licensed User
Longtime 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.

687474703a2f2f7777332e73696e61696d672e636e2f6d773639302f3631306463303334677731656a37356d69327737376732306333306a623471722e676966
 

Attachments

  • libViewAnimatorV1.2.0.zip
    165.2 KB · Views: 999
  • ViewAnimatorEx.zip
    7.9 KB · Views: 1,040
  • ViewAnimationsV1.26.zip
    50.6 KB · Views: 834
Last edited:

susu

Well-Known Member
Licensed User
Longtime 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:

B4X:
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.
 

awakenblueheart

Member
Licensed User
Longtime 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
 

DonManfred

Expert
Licensed User
Longtime User
  • 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
Not needed by your app. They are used ionside the library. Also interpolate.
Will hide them in a future release....
 

awakenblueheart

Member
Licensed User
Longtime 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...:(
 

Embouk

Member
Licensed User
Longtime 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.
 

MichalK73

Well-Known Member
Licensed User
Longtime User
B4X:
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?
 

fredo

Well-Known Member
Licensed User
Longtime User
As clients ask more for animations this is useful as it is very easy to handle.

However, while trying to use
B4X:
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)
 

awakenblueheart

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

Attachments

  • libViewAnimator.zip
    364.8 KB · Views: 357

DonManfred

Expert
Licensed User
Longtime User
Hi, I try to use the method onAnimationStart() but nothing happen
SURE! You defined Anim as Eventname but you are using vanim in your sub-signatures! This is a mistake!

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

Sub Anim_onAnimationEnd()
    Log("endanimation")
End Sub
 

phukol

Active Member
Licensed User
Longtime User
Good day DonManfred!

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

B4X:
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
 
Top