Android端特定PAG文件在4.5.x版本播放抖动
Open
@CodeJhF is already working on this.
Since Aug 25, 2026.
- Dominant language
- HTML
- Stars
- 5.8k
- Forks
- 531
- Avg merge
- 8d 55m
- Merged PRs (30d)
- 17
Description
【版本信息】
libpag:4.5.84
【平台信息】
Android 原生
【预期的表现】
能够播放正常
【实际的情况】
- 在4.5.x版本使用PAGView播放特效会抖动,使用PAGImageView播放特效会跳帧
- 在4.4.35版本播放正常
【Demo及附件】
https://github.com/user-attachments/assets/559643ae-f734-47d7-995f-134740e59da0
`
class PAGTestActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val root = LinearLayout(this).apply {
orientation = LinearLayout.VERTICAL
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
}
setContentView(root)
val playerContainer = FrameLayout(this)
root.addView(
playerContainer,
LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
0,
1f,
)
)
val playerLayoutParams = FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
)
val pagView = PAGView(this).apply {
visibility = View.INVISIBLE
playerContainer.addView(this, playerLayoutParams)
}
val pagImageView = PAGImageView(this).apply {
visibility = View.INVISIBLE
playerContainer.addView(this, playerLayoutParams)
}
val controls = LinearLayout(this).apply {
orientation = LinearLayout.HORIZONTAL
}
root.addView(
controls,
LinearLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
)
)
controls.addView(Button(this).apply {
text = "播放 PAGView"
setOnClickListener {
pagImageView.pause()
pagImageView.visibility = View.INVISIBLE
pagView.visibility = View.VISIBLE
pagView.setRepeatCount(0)
pagView.setPath(PAG_ASSET_PATH)
pagView.play()
}
}, LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f))
controls.addView(Button(this).apply {
text = "播放 PAGImageView"
setOnClickListener {
pagView.pause()
pagView.visibility = View.INVISIBLE
pagImageView.visibility = View.VISIBLE
pagImageView.setRepeatCount(0)
pagImageView.setPath(PAG_ASSET_PATH)
pagImageView.play()
}
}, LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f))
}
companion object {
private const val PAG_ASSET_PATH = "assets://pag/3118272043758928896.pag"
}
}
`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.