I'd like to animate a View (for example a Button, ImageView) that it would appear to be exploding, as with by a bomb. What would be the best approach to implement this? Overlay an explosion frame-based animated sprite over the view? Or is there a possibility to implement this in code somehow?
There are two types of animations that you can do with the view animation framework: Tween animation: Creates an animation by performing a series of transformations on a single image with an Animation. Frame animation: or creates an animation by showing a sequence of images in order with an AnimationDrawable .
You can use the 'ExplosionField' library, it makes it very straightforward. Good luck!
Gradle:
dependencies {
compile 'tyrantgit:explosionfield:1.0.1'
}
Usage:
ExplosionField explosionField = ...;
explosionField.explode(view);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With