提交 16afebf0 编写于 作者: 打打卡夫卡's avatar 打打卡夫卡

修改lottie 资源为 项目static目录

上级 bcca33a3
......@@ -9,7 +9,8 @@
import View from 'android.view.View'
import LottieAnimationView from 'com.airbnb.lottie.LottieAnimationView'
import LottieDrawable from 'com.airbnb.lottie.LottieDrawable'
import FileInputStream from 'java.io.FileInputStream'
import { UTSAndroid } from "io.dcloud.uts";
class CustomAnimListener extends Animator.AnimatorListener {
......@@ -90,11 +91,14 @@
if(this.$el != null){
let lottieAnimationView = this.$el!
if (!TextUtils.isEmpty(newPath)) {
if (newPath.startsWith("http://") || newPath.startsWith("https://")) {
lottieAnimationView.setAnimationFromUrl(newPath)
} else {
// 默认是asset了
lottieAnimationView.setAnimation(newPath)
// 默认是static了
var realJsonPath = UTSAndroid.getResourcePath("static/" + newPath)
lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath)
}
}
if (this.autoplay) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册