Android Lottie (Quick display of the frame animated by Adobe Afeter Effect (AE) tool)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.