[BadgeDrawable] add margin for Badge
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?
Hi @Chaoyang0201 could you please explain how you'd like to position the badge and why gravity is not sufficient?
Hi @wcshi
for example,
I want let a badge could cover the top right corner of the button icon like this

but using gravity can't let badge over the icon .
I checked with our designers and they agree with supporting your use case, will add this to our next sprint.
Glad to hear this : )
The associated PR has been pulled in internally, waiting for the changes to be synced out.
I saw the commit. How to use it to reposition the badge?
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);
@dsn5ft , Did you add this feature? @Chaoyang0201 , How can i use setHorizontalOffset(px)?
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
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
Thank you this work on alpha and beta version.