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

Remove badge on Run time using fragment #58

Closed
vinayaksrs opened this issue Mar 6, 2017 · 8 comments
Closed

Remove badge on Run time using fragment #58

vinayaksrs opened this issue Mar 6, 2017 · 8 comments
Assignees
Labels

Comments

@vinayaksrs
Copy link

Hi,
Thanks for the awesome library. How can I remove only badge on runtime but not hiding entire menu item in fragment.

Thanking you in advance for your time

@praneethrahul
Copy link

Below code might help you.

ActionItemBadge.update(DashBoardActivity.this, menuThis.findItem(R.id.action_notifications), UIUtil.getCompatDrawable(MainActivity.this, R.mipmap.ic_action_notification_icon),
ActionItemBadge.BadgeStyles.TRANSPARENT, NumberUtils.formatNumber(badgeDrawableCount));

@vinayaksrs
Copy link
Author

ActionItemBadge.BadgeStyles.TRANSPARENT and UIUtil.getCompatDrawable(MainActivity.this, R.mipmap.ic_action_notification_icon) are not included in the latest libray

@mikepenz
Copy link
Owner

mikepenz commented Mar 8, 2017

@vinayaksrs if I correctly remember, this is shown in the sample app

@mikepenz mikepenz self-assigned this Mar 8, 2017
@vinayaksrs
Copy link
Author

Nope. I checked the whole library. But i couldn't find ActionItemBadge.BadgeStyles.TRANSPARENT and UIUtil.getCompatDrawable(MainActivity.this, R.mipmap.ic_action_notification_icon). So I am using ActionItemBadge.hide() for now.

UIUtil.getCompatDrawable(MainActivity.this, R.mipmap.ic_action_notification_icon) this functionality removed from latest version 3.3.1

@vinayaksrs
Copy link
Author

@mikepenz ActionItemBadge.hide(), this method removes the icon from menu. I don't want to remove icon. I just want to remove badge only.

This is my scenario, I am showing notification icon in the toolbar menu with unread notification count as badge. When unread notification count become 0, I want to remove the badge but not the menu icon.

@mikepenz
Copy link
Owner

@vinayaksrs set the BadgeCount to null and the badge will hide

@vinayaksrs
Copy link
Author

It worked.. Thank You

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

No branches or pull requests

3 participants