Droppers/AnimatedBottomBar

What is the role of the setEnabled() method in the Badge Class?

Opened this issue · 0 comments

What is the role of the setEnabled() method in the Badge Class?

` override fun setEnabled(enabled: Boolean) {
val lastEnabled = isEnabled
super.setEnabled(enabled)

    if (lastEnabled == enabled) {
        return
    }

    if (animationType == AnimatedBottomBar.BadgeAnimation.NONE) {
        visibility = if (enabled) VISIBLE else GONE
        return
    }

    animator.run {
        duration = _animationDuration.toLong()

        if(isEnabled) {
            start()
        } else {
            reverse()
        }
    }
}`