Home > Software design >  Lottie Animation not fit screen height on Android device
Lottie Animation not fit screen height on Android device

Time:01-30

I'm using Lottie animation but the animation area(height) only reach half of screen even my LottieAnimationView use 0dp to match parent. I'm not sure is this an animate JSON issue, in JSON width is 768 & height is 1500 and I use pixel 6 which is dp 412 x 915 to test. What I want is coins are able to drop full screen, so I tried use scale y but I found the coin shape will transform, plz help, thx.

Lottie version : com.airbnb.android:lottie:5.2.0

The animation file I use the link : enter image description here

The animation looks like below, the coins only drop half height of my screen. enter image description here

CodePudding user response:

I have created demo using your code and yes it is because of json file other wise your code is perfect ..

so you just need to change json file you can use this json file as mentioned below

https://lottiefiles.com/117802-coin-drop

i have tried to create demo using above json file and it is working fine but it is too fast by default so you need to manage speed as per your requirement . You can control speed using app:lottie_speed="0.5"

i hope it will help you

  • Related