PAG 动画在 Android 上只播放一次无法循环,iOS 正常。影响所有循环模式包括 REPEAT_COUNT_LOOP (-1)。#102
Open
yhuang-aeomo wants to merge 5 commits intolibpag:mainfrom
Open
PAG 动画在 Android 上只播放一次无法循环,iOS 正常。影响所有循环模式包括 REPEAT_COUNT_LOOP (-1)。#102yhuang-aeomo wants to merge 5 commits intolibpag:mainfrom
yhuang-aeomo wants to merge 5 commits intolibpag:mainfrom
Conversation
Root cause: two issues combined to prevent animation looping. 1. Replace ValueAnimator with Choreographer for animation driving. ValueAnimator's repeat mechanism was unreliable on Android. Now uses Choreographer (equivalent to iOS CADisplayLink) with manual elapsed-time-based progress calculation, matching iOS implementation exactly. 2. Remove setOnFrameAvailableListener override in FlutterPagPlugin. The plugin was replacing Flutter's internal SurfaceTexture frame listener. It tried to preserve the original via reflection, but this fails on newer Flutter versions (NoSuchFieldException: onFrameListener), causing Flutter to never receive new frame notifications after the first animation cycle. 3. Upgrade libpag from 4.3.68 to 4.5.42 for buffer management fixes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Problem
PAG 动画在 Android 上只播放一次无法循环,iOS 正常。影响所有循环模式包括 REPEAT_COUNT_LOOP (-1)。
Changes (5 commits)
用 Choreographer 替换 ValueAnimator:
移除 setOnFrameAvailableListener 覆盖(根本原因):
移除 v1 Embedding 兼容代码: