I am using Lottie for animations. The problem is lottie view dimensions are too small. is there a way to customize dimensions in lottie?
I tried @Sijansd answer, However LottieComposition.Factory
is deprecated now. So I thought to try with scaling the view. This is what I did to make it work. (Tested and 100% working)
android:scaleType="fitXY"
So the final code looks like this
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lottie_view"
android:layout_width="200dp"
android:scaleType="fitXY"
android:layout_height="30dp"
android:layout_gravity="center"
app:lottie_autoPlay="true"
app:lottie_fileName="animation.json"
app:lottie_loop="true" />
Try Using animation.setScale(0.4f);
0.1f being the smallest.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With