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

修改lottie 资源为 项目static目录

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