更新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();
}
}

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
apply plugin: 'com.android.library'
apply plugin: 'com.android.library'

View File

@@ -66,7 +66,7 @@ dependencies {
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly files('../libs/beautysdk-202202241203.aar')
compileOnly files('../libs/svgaplayer-release-v1.2.aar')
compileOnly files('../libs/svgaplayer-release-v1.2.1.aar')
//直播
api project(':live')
//短视频