Skip to content

v1.6.0 β€” Animated GIF 🎞️

Choose a tag to compare

@ozgesolidkey ozgesolidkey released this 23 Sep 12:24
· 25 commits to main since this release

🎞️ Animated GIF playback (Android + iOS)

KMPMedia now plays animated GIFs β€” on both Android and iOS, from the same one-liner. Before 1.6.0 the image path decoded only a GIF's first frame (a still picture); now the frames actually animate, looping, with the same API as any other image.

OGImageView(
    source = OGImageUrlType("https://example.com/loading.gif"),
    onEventTriggered = { _, _ -> },
    onError = { },
)
  • Point OGImageView at a .gif (URL, file path, or iOS resource) and it plays β€” no API change to existing calls.
  • New rememberOGAnimatedPainter(source, loop = true, speed = 1f, onError = null) in com.solidkey.painpoints.image.gif if you want the playing Painter directly.
  • The same shape clip that crops a still photo works on the moving frames too β€” a GIF animating inside a circle / diamond.
  • No new dependencies β€” native decoders: Android AnimatedImageDrawable (API 28+, static first-frame fallback on 24–27), iOS Skia Codec driven by a small, unit-tested frame clock (OGGifClock).
  • Not GIF-specific: animated WebP and other multi-frame formats ride the same path.

Install

implementation("se.solidkey:kmpmedia-lib:1.6.0")

Cumulative superset β€” also includes the SVG + image/video playback & seek, depth-layer, polygon lasso, video clip-to-shape and audio-sprite features from prior releases.

πŸ“– Docs: docs/GIF.md Β· πŸ“ CHANGELOG

πŸŽ₯ See it in action (Android + iOS captures): the demo app "Animated GIF" screen.