Merge pull request #13 from jisungbin/master

Update usage
This commit is contained in:
oupson 2022-05-03 20:42:31 +02:00 committed by GitHub
commit 0de89f2733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -9,16 +9,16 @@
## To load an animated png to an imageView : ## To load an animated png to an imageView :
```kotlin ```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. You can load a file, an uri, a resource int, an url, or an inputStream.
## With a callback : ## With a callback :
```kotlin ```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 onSuccess(drawable: Drawable) { println("Success !") }
override fun onError(error: Exception) { println("Error : $error") } override fun onError(error: Exception) { println("Error : $error") }
}) })