aurelhubert / ahbottomnavigation

A library to reproduce the behavior of the Bottom Navigation guidelines from Material Design.
3.84k stars 683 forks source link

2.3.3 shows text "null" while animating out notification #398

Closed strooooke closed 5 years ago

strooooke commented 5 years ago

I'm trying to set and remove notifications (without showing any text, just presence/absence of a coloured circle).

Because of design requirements (different size/padding), I'm ignoring everything about notification background color/text color, instead using setNotificationBackground with a circle drawable.

Previously working code (on 2.1.0) was:

        bottomNavigation.setNotification(
                if (badged) " " else null,
                navigationAdapter.getPositionByMenuId(menuItemId)
        )

but changing it to

        val itemPosition = navigationAdapter.getPositionByMenuId(menuItemId)
        if (badged) {
            bottomNavigation.setNotification(" ", itemPosition)
        } else {
            bottomNavigation.setNotification(AHNotification(), itemPosition)
        }

shows the same effect on version 2.3.3: while the notification gets animated out, white-colored text null appears on the notification.

Did I misunderstand how to set a notification state of "there is no notification"?

Works as expected on version 2.3.2; what's up with the String.valueOf( in a63ef9b66d ?

aurelhubert commented 5 years ago

Thanks, it was clearly a bug, a new version is available (2.3.4).

strooooke commented 5 years ago

Cool, thanks!