leandroBorgesFerreira / LoadingButtonAndroid

A button to substitute the ProgressDialog
MIT License
1.94k stars 214 forks source link

revertAnimation() callback not called (2.1.3) #141

Closed Pegeot closed 5 years ago

Pegeot commented 5 years ago

Version: br.com.simplepass:loading-button-android:2.1.3

The callback onAnimationEndListener passed by parameter to function revertAnimation is not being called.

leandroBorgesFerreira commented 5 years ago

fixed in version 2.1.5.

MuriloCalegari commented 5 years ago

@leandroBorgesFerreira, version 2.1.5 did not fix this issue

MuriloCalegari commented 5 years ago

Hi @leandroBorgesFerreira, is this going to be fixed? What is the procedure for debugging it?

MuriloCalegari commented 5 years ago

At:

internal fun applyAnimationEndListener(animator: Animator, onAnimationEndListener: () -> Unit) =
    animator.addListener(object : AnimatorListenerAdapter() {
        override fun onAnimationEnd(animation: Animator?) {
            onAnimationEndListener()
            animator.removeListener(this)
        }
    })

onAnimationEnd() is never called when it is supposed to be. But if I reclick the button after the animation has ended, then onAnimationEnd() is called and consequently onAnimationEndListener() works.