Site icon Android Tutorial Online

Android bindings to image-rs for APNG support

CircleCI

android-apngrs

Bindings to image-rs for APNG support on Android.

Usage

You can include the decoder with

implementation("me.tatarka.android:anpngrs:0.1")

Then you can create a source and decode a drawable. The api is mirrored after ImageDecoder.

val source = ApngDecoder.source(resources, R.drawable.my_animated_png)
val drawable = ApngDecoder.decodeDrawable(source)
drawable.start() // to start the animation.

Coil Integration

For easy coil integration, include

implementation("me.tatarka.android:anpngrs-coil:0.1")

and then add the decoder

val imageLoader = ImageLoader.Builder(context)
    .components {
        add(ApngDecoderDecoder.Factory())
    }
    .build()

Current Limitations/Possible Future Directions

GitHub

View Github

Exit mobile version