question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BadgeDrawable] add margin for Badge

See original GitHub issue

I’m using badge with BottomNavigationView ,
but the badge position only change by gravity , so I can’t control the position of badge

Is there any plan to add something like margin to control the position of badge?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

22reactions
Chaoyang0201commented, Feb 19, 2020

I saw the commit. How to use it to reposition the badge?

if you are using BottomNavigationView, you can reposition the badge like this

BadgeDrawable badge = bottomNavigationView.getOrCreateBadge(YOUR_MENU_ITEM_ID);
badge.setHorizontalOffset(px);
badge.setVerticalOffset(px);
4reactions
Chaoyang0201commented, Jun 8, 2020

I saw the commit. How to use it to reposition the badge?

if you are using BottomNavigationView, you can reposition the badge like this

BadgeDrawable badge = bottomNavigationView.getOrCreateBadge(YOUR_MENU_ITEM_ID);
badge.setHorizontalOffset(px);
badge.setVerticalOffset(px);

@miladsalimiiii have a try

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - Badge on bottomNavigationView padding or margin
You can use the method setVerticalOffset : BadgeDrawable badge = bottomNavigationView.getOrCreateBadge(menuItemId); badge.setNumber(.
Read more >
BadgeDrawable - Android Developers
Add BadgeDrawable as a ViewOverlay to the desired anchor view using BadgeUtils#attachBadgeDrawable(BadgeDrawable, View, FrameLayout) (This ...
Read more >
Badge - Material Design
Add BadgeDrawable as a ViewOverlay to the desired anchor view. Update the BadgeDrawable's coordinates (center and bounds) based on its anchor view using ......
Read more >
Badge on bottomNavigationView padding or margin-kotlin
Coding example for the question Badge on bottomNavigationView padding or margin-kotlin. ... BadgeDrawable badge = bottomNavigationView.
Read more >
Badge On Bottomnavigationview Padding Or Margin - ADocLib
Drawable Badge Drawable Badge is a android library for adding badges to badgeMargin : Badge margin supported @DimenRes or @Px default 0. To...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found