提交 cb906614 编写于 作者: 杜庆泉's avatar 杜庆泉

anim-view 适配asset模式

上级 ff124248
......@@ -93,9 +93,13 @@
if (newPath.startsWith("http://") || newPath.startsWith("https://")) {
lottieAnimationView.setAnimationFromUrl(newPath)
} else {
// 默认是static了
var realJsonPath = UTSAndroid.getResourcePath(newPath)
lottieAnimationView.setAnimation(new FileInputStream(realJsonPath),newPath)
// 正式打包会放在asset中,需要特殊处理
let realJsonPath = UTSAndroid.getResourcePath(newPath)
if(realJsonPath.startsWith("/android_asset")){
lottieAnimationView.setAnimation(realJsonPath!.substring(15))
}else{
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.
先完成此消息的编辑!
想要评论请 注册