B4A Library SVGAPlayer Library

Hi , This is my first wrapper that I ever Created on This Forum.
First of all I Want to thanks @OliverA who have been great support to me that give me the motive to start creating wrappers.
also I want to Thanks @moster67 for his Tutorial that gives the spark into my brain.
after many situations that I had to deal with and many fails and greed from a few members here in order to get a github project to be wrapped , I decided to learn the whole thing .
matter of fact wrapping a library from github to b4x is kind of simple but although needs a good knowledge in java.
I have successfully wrapped a library that I needed to use for a personal needs. and I decided to share it for free.
as this was my first wrapper in this forum I will post it for free. a small donation are very welcome.

This Library is based on this Github Library

What is SVGAPlayer ?

SVGAPlayer is a light-weight animation renderer. You use tools to export svga file from Adobe Animate CC or Adobe After Effects, and then use SVGAPlayer to render animation on mobile application.

SVGAPlayer-Android render animation natively via Android Canvas Library, brings you a high-performance, low-cost animation experience.


Events
  • Click
  • LongClick
  • OnComplete
    • This event will be fired when Parsing Svga File is completed.
  • onError
    • This event will be raised whenever something unexpected happened
Designer Properties
  • fillMode
    • You can choose between this List {Forward|Backward|Clear}
  • Loop
    • You Can set the animation loops count of the SVGAIMAGEVIEW From the designer.
  • clearsAfterDetached: Boolean
    • Defaults to false.Clears canvas and the internal data of SVGAVideoEntity after SVGAImageView detached.
Functions
  • PlaySvga
    • This function will be used to play svgaFile from assets folder, in a new version i will add the ability to add svga from URL which is already implemented in the library
  • SetfillMode
  • GetfillMode
  • SetLoop
  • GetLoop
  • SetclearsAfterDetached
  • GetclearsAfterDetached
  • StartAnimation
  • StopAnimation

A demo can be downloaded here Since upload size is limited in the forum.

Download B4A Demo

Requirments
okhttp library
wire-runtime-jvm-4.3.0.jar {in Additonal Folder}

svglib-release.aar {in Additonal Folder}
kotlin-stdlib-1.6.10.jar {in Additonal Folder} newer b4a versions has already kotlin stdlib in the library folder.

Demo is Using XcustomlistView You can make your own how ever you like.

As a Thanks to @OliverA you can donate for this library at his
paypal address if you like. Thanks and have a great day everyone.
 

Attachments

  • SvgaLibrary.zip
    402.7 KB · Views: 128
Last edited:

Addo

Well-Known Member
Licensed User
Version 1.10
ChangeLog :

  • Changed PlaySvga function name to PlaySvgaFromAssets
  • Added New Function PlaySvgaFromURL : it will play svga animation from url you can implement caching by your self .
  • Added android.permission.INTERNET Premission in order to get PlaySvgaFromURL to work.
  • Fixed the deprecation of android handler within the original library.
 

Attachments

  • SvgaLibrary.zip
    403.4 KB · Views: 90

Addo

Well-Known Member
Licensed User
Version 1.2
ChangeLog :
Removed onComplete event.
Added onFinished event.
Added onPause event.
Added onRepeat event.
Added onStep(frame As int, percentage As Double) event.
Added a new Parameter To PlaySvgaFromURL , PlaySvgaFromAssets to set anti aliasing to true or false default is true.
 

Attachments

  • SvgaLibrary-1.2.zip
    404.6 KB · Views: 119
Top