Skip to content

Instantly share code, notes, and snippets.

@PSPanishetti
Last active July 13, 2019 14:07
Show Gist options
  • Save PSPanishetti/a5ff4b0ce869c123eed2acf4aa95f2da to your computer and use it in GitHub Desktop.
Save PSPanishetti/a5ff4b0ce869c123eed2acf4aa95f2da to your computer and use it in GitHub Desktop.
Lottie Animation Example
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10"
tools:context=".MainActivity">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/animation_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="8"
app:lottie_loop="true"
app:lottie_autoPlay="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="horizontal"
android:gravity="center"
android:layout_weight="2">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="confettiAnim"
android:text="confetti"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="happyBirthDay"
android:text="Happy Birthday"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="motorCycle"
android:text="Bicycle"/>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment