Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,20 @@

public class ExplosionField extends View {

public interface Listener {
void onExplosionFinish();
}

private List<ExplosionAnimator> mExplosions = new ArrayList<>();
private int[] mExpandInset = new int[2];

private Listener listener;

public ExplosionField listener(Listener listener) {
this.listener = listener;
return this;
}

public ExplosionField(Context context) {
super(context);
init();
Expand Down Expand Up @@ -105,6 +116,14 @@ public void onAnimationUpdate(ValueAnimator animation) {

}
});
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (listener != null) {
listener.onExplosionFinish();
}
}
});
animator.start();
view.animate().setDuration(150).setStartDelay(startDelay).scaleX(0f).scaleY(0f).alpha(0f).start();
explode(Utils.createBitmapFromView(view), r, startDelay, ExplosionAnimator.DEFAULT_DURATION);
Expand Down