tyrantgit / ExplosionField

explosive dust effect for views
3.6k stars 578 forks source link

Added ExplosionFinish() listener #22

Open prokash-sarkar opened 7 years ago

prokash-sarkar commented 7 years ago

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

Khoosham commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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)