From 2a84801624d3564cfbd5c62f7dbd7473bd2974bb Mon Sep 17 00:00:00 2001 From: Ji Sungbin Date: Sun, 1 May 2022 18:54:54 +0900 Subject: [PATCH] Update usage --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1684350..f9bd17b 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,16 @@ ## To load an animated png to an imageView : ```kotlin -val imageUrl = "https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png" +val imageUrl = URL("https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png") -ApngDecoder.decodeApngAsyncInto(context, URL(url), imageView) +ApngDecoder.decodeApngAsyncInto(context, imageUrl, imageView) ``` You can load a file, an uri, a resource int, an url, or an inputStream. ## With a callback : ```kotlin -ApngDecoder.decodeApngAsyncInto(this, uri, viewerImageView, callback = object : ApngDecoder.Callback { +ApngDecoder.decodeApngAsyncInto(context, imageUrl, imageView, callback = object : ApngDecoder.Callback { override fun onSuccess(drawable: Drawable) { println("Success !") } override fun onError(error: Exception) { println("Error : $error") } })