Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All icons disappears when i set badge twice #33

Open
iballan opened this issue Aug 10, 2021 · 0 comments
Open

All icons disappears when i set badge twice #33

iballan opened this issue Aug 10, 2021 · 0 comments

Comments

@iballan
Copy link

iballan commented Aug 10, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant