更新SVGA库:新增获取动画持续时间方法

This commit is contained in:
2022-10-10 16:10:15 +08:00
parent f202fdd08d
commit 8f37f3cc6d
5 changed files with 3 additions and 13 deletions

View File

@@ -66,16 +66,6 @@ public class SVGAViewUtils {
* 获取svga动画播放时间
*/
public static long getPlayTimer(SVGAImageView svga){
try {
Field mAnimator = svga.getClass().getDeclaredField("mAnimator");
mAnimator.setAccessible(true);
ValueAnimator animator = (ValueAnimator) mAnimator.get(svga);
if(animator!=null) {
return animator.getDuration();
}
} catch (Exception e) {
e.printStackTrace();
}
return 0;
return svga.getPlayDuration();
}
}