# lottie-ohos **Repository Path**: HarmonyOS-tpc/lottie-ohos ## Basic Information - **Project Name**: lottie-ohos - **Description**: Lottie is a mobile library that parses Adobe After Effects animations exported as json and renders them natively on mobile. - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 10 - **Forks**: 4 - **Created**: 2021-04-01 - **Last Updated**: 2025-03-21 ## Categories & Tags **Categories**: harmonyos-animate **Tags**: None ## README # Introduction Lottie-ohos: Lottie is a mobile library that parses Adobe After Effects animations exported as json and renders them natively on mobile. # Usage Instructions Declare the lottie animation view in layout as shown below : ``` ``` For playing animation using json/zip file: ``` LottieAnimationView lv = (LottieAnimationView)rootLayout.findComponentById(ResourceTable.Id_animationView); LottieAnimationViewData data = new LottieAnimationViewData(); data.setFilename(string); data.autoPlay = true; data.setRepeatCount(repeatCount); // specify repetition count lv.setAnimationData(data); ``` where string is the json or zip file name which needs to be displayed. For loading animation from URL : ``` LottieAnimationView lv = (LottieAnimationView)rootLayout.findComponentById(ResourceTable.Id_animationView); LottieAnimationViewData data = new LottieAnimationViewData(); data.setUrl(string); data.autoPlay = true; data.setRepeatCount(repeatCount); // specify repetition count lv.setAnimationData(data); ``` where string is the url path to the json file to be loaded. # Installation tutorial 1) For using Lottie module in sample app, modify entry build.gradle as below : dependencies { implementation project(':lottie') } 2) For using Lottie in separate application make sure to add lottie.har in entry/libs folder and modify build.gradle as below to add dependencies : dependencies { implementation fileTree(dir: 'libs', include: [ '*.jar', ' *.har']) } 3) For using Lottie from a remote repository in separate application, add the below dependencies: Modify entry build.gradle as below : ``` dependencies { implementation fileTree(dir: 'libs', include: ['*.har']) implementation 'io.openharmony.tpc.thirdlib:lottie-ohos:1.0.8' }