
Security News
CISA Kills Off RSS Feeds for KEVs and Cyber Alerts
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
com.github.penfeizhou.android.animation:awebpencoder
Advanced tools
Android animation support for APNG & Animated WebP & Gif
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.penfeizhou.android.animation:awebp:${VERSION}'
}
dependencies {
implementation 'com.github.penfeizhou.android.animation:apng:${VERSION}'
}
dependencies {
implementation 'com.github.penfeizhou.android.animation:gif:${VERSION}'
}
dependencies {
implementation 'com.github.penfeizhou.android.animation:avif:${VERSION}'
}
Notice Before Use!
Don't put APNG resources in your drawable or mipmap directory!
During the process of release building of an Android app, the aapt tool will zip & modify the frame info of the APNG file, which will lead to an abnormal behavior when playing it. Thus, please put the APNG resources in raw
or assets
folder instead.
// Load from asset file
AssetStreamLoader assetLoader = new AssetStreamLoader(context, "wheel.png");
// Load form Resource
ResourceStreamLoader resourceLoader = new ResourceStreamLoader(context, R.drawable.sample);
// Load from file
FileStreamLoader fileLoader = new FileStreamLoader("/sdcard/Pictures/1.webp");
// Create APNG Drawable
APNGDrawable apngDrawable = new APNGDrawable(assetLoader);
//Create Animated webp drawable
WebPDrawable webpDrawable = new WebPDrawable(assetLoader);
//Create Animated avif drawable
AVIFDrawable avifDrawable = new AVIFDrawable(assetLoader);
// Auto play
imageView.setImageDrawable(apngDrawable);
// Not needed.default controlled by content
apngDrawable.setLoopLimit(10);
// Implement Animatable2Compat
drawable.registerAnimationCallback(new Animatable2Compat.AnimationCallback() {
@Override
public void onAnimationStart(Drawable drawable) {
super.onAnimationStart(drawable);
}
});
repositories {
...
mavenCentral()
}
dependencies {
implementation 'com.github.penfeizhou.android.animation:glide-plugin:${VERSION}'
}
Glide.with(imageView).load("https://misc.aotu.io/ONE-SUNDAY/SteamEngine.png").into(imageView);
Glide.with(imageView).load("https://isparta.github.io/compare-webp/image/gif_webp/webp/2.webp").into(imageView);
FAQs
Android animation support for APNG & Animated WebP & Gif
We found that com.github.penfeizhou.android.animation:awebpencoder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA is discontinuing official RSS support for KEV and cybersecurity alerts, shifting updates to email and social media, disrupting automation workflows.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.