[英]How to improve Lottie animation performance on android
How can I improve the performance of animations playing on older devices? 如何提高在旧设备上播放动画的性能? I've tried using an anonymous
Handler
and myLooper
thread but the app still lags on older deviced, how can I fix this? 我曾尝试使用匿名
Handler
和myLooper
线程,但该应用程序仍落后于旧设备,如何解决此问题?
I tried to wait for the animation to finish before resuming other processes but whenever I tried that using animationName.isRunning
the app just freezes. 我试图等待动画完成再恢复其他进程,但是每当我使用
animationName.isRunning
尝试运行该应用程序时,它就会冻结。
code (running in a fragment) : 代码(片段运行) :
if(this.confetti.isHardwareAccelerated()) {
new Handler(Looper.getMainLooper()).post(() -> {
confetti.playAnimation();
});
}
尝试使用图像而不是矢量来解决复杂的矢量问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.