Skip to content

Commit

Permalink
Replaced faulty onAnimationEnd listener by postDelayed call (#708) (#774
Browse files Browse the repository at this point in the history
)
  • Loading branch information
xvarlez authored and yombunker committed May 17, 2017
1 parent 18f8290 commit 711fcaf
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.roughike.bottombar;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.content.Context;
Expand Down Expand Up @@ -493,15 +491,19 @@ public void onAnimationUpdate(ValueAnimator animator) {
setLayoutParams(params);
}
});
animator.addListener(new AnimatorListenerAdapter() {

// Workaround to avoid using faulty onAnimationEnd() listener
postDelayed(new Runnable() {
@Override
public void onAnimationEnd(Animator animation) {
public void run() {
if (!isActive && badge != null) {
clearAnimation();
badge.adjustPositionAndSize(BottomBarTab.this);
badge.show();
}
}
});
}, animator.getDuration());

animator.start();
}

Expand Down

0 comments on commit 711fcaf

Please sign in to comment.