All icons disappears when i set badge twice
iballan opened this issue · 0 comments
In the activity's onResume function I added code to check badge every time activity rersumes:
if (badgeNumber > 0) bn_menu.setBadgeAtTabIndex(1, AnimatedBottomBar.Badge("$badgeNumber")) else bn_menu.clearBadgeAtTabIndex(1)
So this code caused an issue to the users.
i improved it to be like this and the issue was solved:
val notifTab = bn_menu.tabs[1] if (badgeNumber > 0) { if (notifTab.badge == null) { bn_menu.setBadgeAtTab(notifTab, AnimatedBottomBar.Badge("$badgeNumber")) } } else { if(notifTab.badge != null) { bn_menu.clearBadgeAtTab(notifTab) } }
But the issue here that the badge is not updated once it is added. Only cleared if badge is 0.
I think those checks must be done inside the library, like if I call clearBadgeAtTab
or setBadgeAtTab(notifTab, AnimatedBottomBar.Badge("$badgeNumber"))
twice It must not hide all icons.