An android library to create or display apng
Go to file
oupson a8ad3c4e4d 1.0.10-beta2 2020-04-20 16:44:22 +02:00
.idea https://github.com/oupson/Kapng-Android/issues/6 2020-04-20 11:39:46 +02:00
apng_library 1.0.10-beta2 2020-04-20 16:44:22 +02:00
app-test 1.0.10-beta2 2020-04-20 16:44:22 +02:00
gradle/wrapper https://github.com/oupson/Kapng-Android/issues/6 2020-04-20 11:39:46 +02:00
.gitignore Fixing bug 2020-04-20 16:18:16 +02:00
LICENSE Create LICENSE 2018-09-29 21:38:44 +02:00
README.md Release 2019-06-13 11:01:48 +02:00
build.gradle https://github.com/oupson/Kapng-Android/issues/6 2020-04-20 11:39:46 +02:00
gradle.properties Update to androidx 2019-05-17 18:48:32 +02:00
gradlew Initial commit 2018-09-27 22:05:08 +02:00
gradlew.bat Initial commit 2018-09-27 22:05:08 +02:00
settings.gradle Initial commit 2018-09-27 22:05:08 +02:00

README.md

Kapng-Android

An android library to create or display apng

Example of apng :

apng-example

How to use this library :

To load animated png to an imageView :

val imageUrl = "https://upload.wikimedia.org/wikipedia/commons/1/14/Animated_PNG_example_bouncing_beach_ball.png" // image url could be an url, or a file path. You could also load byteArray and file

val animator = imageView.load(imageUrl)

To create animated png :


val apng = Apng()

val file1 = File("image path 1")
val file2 = File("image path 2")

apng.addFrames(BitmapFactory.decodeByteArray(file1.readBytes(), 0, file1.readBytes().size))
apng.addFrames(BitmapFactory.decodeByteArray(file2.readBytes(), 0, file2.readBytes().size))

val apngByteArray = apng.generateAPNGByteArray()
File("output file path").writeBytes(apngByteArray)

How to install : Via jitpack

repositories {
  maven { url "https://jitpack.io" }
 }
 
 dependencies {
  implementation 'com.github.oupson:Kapng-Android:1.0.9'
 }

Or put the aar file in /libs/ and verify that you have :

 dependencies {
   implementation fileTree(include: ['*.aar'], dir: 'libs')
 }