B4J Library Lottie animation

This is an attempt to bring lottie files to b4j. The .jar and .xml are there to be used. Put them in the additional libraries folder.
Call from inside b4j (LottieView) as a custom view in the designer then set the path of the lottie file (.json) which is either
-a local file must be in Objects folder (as travelling.json) or
-a URL to the online json file as 'https://lottie.host/77b574f0-9dc3-4a9b-9ef0-59733c976fc9/sM7os2UHYj.json'
*The following properties are currently available at design time:
*Lottie Path (string)
*Lottie Speed (Int)
*Autoplay (Boolean)
The other properties are still fragile.
There is an example project which includes a textFlow class taken from the forum and it can be used to add fun to the lottie display and beautify the UI.
 

Attachments

  • LottieView.zip
    14 KB · Views: 164
  • b4j_lottie_Example.zip
    3.2 KB · Views: 160

wimpie3

Well-Known Member
Licensed User
Longtime User
There seems to be an issue, the animation is not showing up. This is what I get in the debugger:
B4X:
url: bouncingpresent.json
we_getdata url: bouncingpresent.json
file:///C:/TESTSC~1/clv/B4J/Objects/bouncingpresent.html
Bridge set: com.prosoft.lottieCV.cvlottie$Bridge@1ed6aa67 member: 'b4j'

You're basically showing the Lottie javascript in a html container, right? That was how I did it previously myself. It's slower than the Android library, which interprets the json code instead of just sending it to a javascript.
 
Last edited:

jkhazraji

Active Member
Licensed User
Longtime User
There seems to be an issue, the animation is not showing up. This is what I get in the debugger:
B4X:
url: bouncingpresent.json
we_getdata url: bouncingpresent.json
file:///C:/TESTSC~1/clv/B4J/Objects/bouncingpresent.html
Bridge set: com.prosoft.lottieCV.cvlottie$Bridge@1ed6aa67 member: 'b4j'
What is that directory?
 
Top