glomadrian / material-animated-switch

A material Switch with icon animations and color transitions
1.18k stars 158 forks source link

Listener called twice when switch checked. #8

Open Chirag27592 opened 9 years ago

Chirag27592 commented 9 years ago

when toggle switch it's listener called two times . untitled

kmenager commented 9 years ago

I think there the methode onAnimationEnd() is called twice because the BallShadowPainter inherited from BallPainter. When doActionDown is called, it set state for all ballPainter and ballShadowPainter. The setState method from BallPainter which call moveAnimator.start()/reverse(). When the ballPainter and ballShadowPainter, they both call the onAnimationEnd().

DenisGL commented 9 years ago

I also have the same issue.

jkwiecien commented 8 years ago

Same issue

javadbacker commented 4 years ago

Same issue here