community icon indicating copy to clipboard operation
community copied to clipboard

Lottie animation widget

Open Googler43 opened this issue 3 years ago • 9 comments
trafficstars

Good afternoon. Please add the ability to insert lottie animation as a widget

Googler43 avatar Sep 04 '22 12:09 Googler43

You can adjust the speed of a gif in AsyncImage using the anim_delay property

drahba avatar Sep 10 '22 21:09 drahba

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

Googler43 avatar Sep 15 '22 12:09 Googler43

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.

salvecom333 avatar Jun 07 '23 06:06 salvecom333

With the new buildozer there is another way to add lottie animation and bypass python coding;

  1. Add lottie.json to the raw folder
  2. Create a java class that adds the lottie and add the java class to the java_src
  3. Autoclass with pyjnius and use the class in your main.py
  4. Add air bnb lottie to your dependencies in the spec file This use is very similar to adding ads to your program

drahba avatar Jun 07 '23 19:06 drahba

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.

salvecom333 avatar Jun 14 '23 00:06 salvecom333

any update on this issue? is there a workaround now to display Lottie animation?

farzadpanahi avatar Feb 17 '24 00:02 farzadpanahi

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.

Julian-O avatar Feb 17 '24 03:02 Julian-O

is it solved or not ?

Sahil-pixel avatar Mar 16 '24 12:03 Sahil-pixel

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?)

misl6 avatar Mar 16 '24 17:03 misl6