Tencent / libpag

The official rendering library for PAG (Portable Animated Graphics) files that renders After Effects animations natively across multiple platforms.
https://pag.art
Other
4.79k stars 439 forks source link

鸿蒙2 pag动画 不显示 #596

Closed i-farmer closed 1 year ago

i-farmer commented 1 year ago

Which Version of libpag are you using?

libpag 4.0.5.66、4.0.5.82

What Platform are you on?

image 上面是不显示的机型

image 这个机型,就可以显示

Code Example

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <org.libpag.PAGView
            android:id="@+id/mAnimView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </FrameLayout>
</layout>
binding?.mAnimView?.let {
            it.composition = PAGFile.Load(context.assets, "loading.pag")
            it.addListener(object : PAGViewListenerAdapter() {

                override fun onAnimationEnd(view: PAGView) {
                    dismiss()
                }
            })
            it.post { it.play() }
        }

PAG File

loading.pag.zip

i-farmer commented 1 year ago

现象是这样子的,前面我拿那只手机调试,PAGFile.Load正确加载,也可以正常运行到ValueAnimator.start(),没有抛出任何错误,但是就是不显示;然后刚刚 包没换(还是最开始发现bug的那个包),结果可以显示了。

i-farmer commented 1 year ago

请教我要怎么排查问题

domchen commented 1 year ago

@i-farmer i你可以检查一下有问题的那个手机其他动画内容是否正常,是不是在系统设置里全局关闭了动画功能。

jzqCode commented 1 year ago

无障碍服务里面的动画 关闭了pag就不能用了。

kevingpqi123 commented 1 year ago

PAG 动画播放基于的是系统的 ValueAnimator,一切会影响到 ValueAnimator 正常使用的设置或操作,同样会影响到 PAGView