sketch icon indicating copy to clipboard operation
sketch copied to clipboard

Enhance GIF playback to retain the last frame after animation ends

Open bevice1 opened this issue 1 year ago • 1 comments

Description:

We are using a GIF that has a completely white first frame, and we want the GIF to animate once and then keep the last frame visible after it finishes. However, the current behavior causes the GIF to revert back to the first frame once the animation is complete, which results in an undesired visual effect.

This behavior works as expected on Android, where the last frame remains displayed after the animation finishes, but on iOS, the GIF resets to the first frame once the animation ends.

Feature Request:

We would like to request a feature enhancement that allows us to:

  1. Animate a GIF once.
  2. After the animation finishes, have the last frame of the GIF remain displayed on the screen (instead of resetting back to the first frame).

The relevant code where this behavior seems to occur is in SkiaAnimatedImagePainter.kt at Line 109.

Questions:

  • Are there any existing plans to support this behavior in iOS to achieve parity with Android?
  • Would it be possible to introduce an option or parameter (e.g., retainLastFrame) to control this behavior across platforms?

This would greatly improve our user experience by allowing us to better control the visual flow of animated images in our application.

Thank you for considering this request!

bevice1 avatar Oct 14 '24 08:10 bevice1

It has been fixed on the dev branch and a new version will be released soon

panpf avatar Oct 14 '24 09:10 panpf

Fixed in v4.0.0-beta01

panpf avatar Nov 07 '24 09:11 panpf