community
community copied to clipboard
Lottie animation widget
Good afternoon. Please add the ability to insert lottie animation as a widget
You can adjust the speed of a gif in AsyncImage using the anim_delay property
You can adjust the speed of a gif in AsyncImage using the anim_delay property
You are right I can use gif but lottie has at least 2 virtues. 1. Vector graphics. 2. json takes up much less disk space than gif
Yes please add a lottie animation widget, it will save so much space. Gif animation takes up alot of ram when the app is compiled. i had to lower the frames from a 144 frame gif to 3 frames and used anim_delay=1/3 so it will render in a normal speed. without these modification just to render the gif will take 1 gb of ram for the gif specified. with the modification, the ram consumption of the app was around 243mb. i only use 1 gif in my app. Without the gif my app uses 210mb of ram when running. I used andriod studio to see my ram usage with the profile option. I've searched on how i can implement lottie with kivy and i can't seem to find an answer. I'm not that well versed in kivy or lottie. Just switching to the lottie splash screen in the buildozer spec tremendously sped up the loading of the app, it uses less ram, loads way faster. I'm searching to save ram usage, because i tried to run my kivy app in a android tablet that i had and it crashed it. I saw the logs that it was due to insufficent space the android platform automatically killed my app process. Thus i looked for ways to make the gif work to save on ram usage. Implementing a lottie animation widget will not only save on ram usage of the app, you can add more animations in your app making it more desirable to use and fun. If someone in the kivy community has a way to implement lottie animation besides the splash screen, please share.
With the new buildozer there is another way to add lottie animation and bypass python coding;
- Add lottie.json to the raw folder
- Create a java class that adds the lottie and add the java class to the java_src
- Autoclass with pyjnius and use the class in your main.py
- Add air bnb lottie to your dependencies in the spec file This use is very similar to adding ads to your program
Thank you for your response. I will implement this as soon as i can. Sorry for the late response. I am going to be adding ads to my kivy app as well.
any update on this issue? is there a workaround now to display Lottie animation?
No update. This isn't a priority. This is an open source project run by volunteers, so feel free to look the code yourself and submit a Pull Request.
is it solved or not ?
Hi @Sahil-pixel,
Soon we will start adding the Skia renderer for text, and this will also allow us to have a lottie animation widget (maybe in garden?)