Skip to content

Conversation

prokash-sarkar
Copy link

Added a simple listener to trigger the event when the ExplosionField animation is finished.

@Khoosham
Copy link

can you explain how to use it please for example i want to show a toast when the animation ends.
how do i do this? thank you.

@prokash-sarkar
Copy link
Author

Hi, in order to use the explosion finish listener you need to manually clone the repo and add the commit I pushed. After that use the following code,

ExplosionField explosionField = ExplosionField.attach2Window(MyActivity.this);
explosionField.explode(myLayout);
explosionField.listener(new ExplosionField.Listener() {
@OverRide
public void onExplosionFinish() {
// perform action here
}
});

@Khoosham
Copy link

thanks i got it working but there is a little issue
if i have several image and click on it at the same time it crashes

java.lang.NullPointerException at com........ContactFragment$1.onExplosionFinish(ContactFragment.java:28)
                                              atcom.........Explosion.ExplosionField$3.onAnimationEnd(ExplosionField.java:107)                                                    atandroid.animation.ValueAnimator.endAnimation((ValueAnimator.java:1020)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants