Top items WITH an icon in the NavigationBar can show a little 'ios' badge with e.g. a number of unread messages.
Note: you can only start using them AFTER page.FinishedLoading!
Example:
Code (where 'Emails' is the return name of the top button):
Adding/Setting the badge:
You can rerun the .SetTopBarBadgeOnIcon() method, e.g. if the number has changed. I did it like this, so you can also change its color too depending on the value.
Removing the Badge:
Note: you can only start using them AFTER page.FinishedLoading!
Example:
Code (where 'Emails' is the return name of the top button):
Adding/Setting the badge:
B4X:
page.NavigationBar.SetTopBarBadgeOnIcon("Emails", "5",ABM.ICONBADGE_POSITION_TOPRIGHT, ABM.COLOR_RED, ABM.INTENSITY_NORMAL, ABM.COLOR_WHITE, ABM.INTENSITY_NORMAL, ABM.COLOR_WHITE, ABM.INTENSITY_NORMAL)
Removing the Badge:
B4X:
page.NavigationBar.HideTopBarBadgeOnIcon("Emails")