v1.6.0 β Animated GIF ποΈ
ποΈ 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
OGImageViewat 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)incom.solidkey.painpoints.image.gifif you want the playingPainterdirectly. - 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 SkiaCodecdriven 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.