Skip to content

Commit cba1b83

Browse files
committed
Fix menu button icon changing
1 parent 17327bc commit cba1b83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

circle-menu/src/main/java/com/ramotion/circlemenu/CircleMenuView.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,12 @@ private Animator getOpenMenuAnimation() {
402402
final PropertyValuesHolder pvhRotation = PropertyValuesHolder.ofKeyframe("rotation", kf0, kf1, kf2);
403403
final ObjectAnimator rotateAnimation = ObjectAnimator.ofPropertyValuesHolder(mMenuButton, pvhRotation);
404404
rotateAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
405+
private boolean iconChanged = false;
405406
@Override
406407
public void onAnimationUpdate(ValueAnimator valueAnimator) {
407-
if (valueAnimator.getAnimatedFraction() == 0.5f) {
408+
final float fraction = valueAnimator.getAnimatedFraction();
409+
if (fraction >= 0.5f && !iconChanged) {
410+
iconChanged = true;
408411
mMenuButton.setImageResource(mIconClose);
409412
}
410413
}

0 commit comments

Comments
 (0)