Android Question Show badge on ACMenuItem shown on ToolBar

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

I am using AppCompat and on the ToolBar I have an icon which acts as a menu. I have used the following code
B4X:
Private ActionBar As ACToolBarDark
  'Set the ToolBar (it is called ActionBar in the layout file) as the ActionBar of this activity.
   ActionBar.SetAsActionBar

#IgnoreWarnings: 11
Sub Activity_CreateMenu(Menu As ACMenu)
    Menu.Clear

    Dim Notifications As MSIconicDrawable : Notifications.Initialize("gmd_notifications") :  Notifications.Color = 0xffffffff
    Dim item As ACMenuItem
 
    'I would like to add the Badge on this ACMenuItem
    Menu.Add2(20, 2, "Notifications", Notifications.Drawable).ShowAsAction = item.SHOW_AS_ACTION_ALWAYS

End Sub

I would like to know that whether is there any view/library available for B4A to display a Badge on the Notification Icon. The below given picture shows my requirement.

1.png


Another Picture
2.png


I have located 2 libraries BadgeView and ViewTagger by DonManfred, but I understand that it can be used only on views and not on the ACMenuItem and also the badge is oval shaped and is not round in shape.

Any advice will be appreciated

Regards

Anser
 

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

Any idea on how to achieve the above said on ACMenuItem
 
Last edited:
Upvote 0
Top