Step 1:- put this dependancy to your project
def lottieVersion = "3.4.0"
implementation 'com.airbnb.android:lottie:$lottieVersion'
Step 2 :- Add LottieAnimationView to your layout wher you want to show
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:lottie_url="REPLACE_JSON_URL"
app:lottie_autoPlay="true"
app:lottie_loop="true"/>
There is to type to set lotti file to layout First is using withe jason url or Second is
put animation file to your project call direct.
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animationView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:lottie_rawRes="@raw/animation" //past lotti file to res>raw>lottifile name
app:lottie_autoPlay="true"
app:lottie_loop="true"/>
0 Comments
Post a Comment