Add dependency
compile ‘com.airbnb.android:lottie:2.2.0‘
Go to download Demo
Copy the assets folder from the example in the project to your new project
Https://github.com/airbnb/lottie-android
<?xml version= "1.0" encoding= "Utf-8"?>< Relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools "xmlns:app=" Http://schemas.android.com/apk/res-auto "android:layout_width=" Match_ Parent "android:layout_height=" match_parent "> <com.airbnb.lottie.lottieanimationview android:id=" @+id/l Av_show "android:layout_width=" wrap_content "android:layout_height=" wrap_content "App:lottie_filename=" Hell o World.json "app:lottie_loop=" true "app:lottie_autoplay=" true "/></RELATIVELAYOUT>
public class MainActivity extends AppCompatActivity { private LottieAnimationView lav_show; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); lav_show = (LottieAnimationView) findViewById(R.id.lav_show); LottieComposition.Factory.fromAssetFileName(this, "City.json", new OnCompositionLoadedListener() { @Override public void onCompositionLoaded(@Nullable LottieComposition composition) { lav_show.setComposition(composition); } }); }}
Android Lottie (Quick display of the frame animated by Adobe Afeter Effect (AE) tool)