B4J Question [ABMaterial] Refresh NavigationBar TopItems Text and Color

mindful

Active Member
Licensed User
Is it possible to modify the navigationbar topitems text at runtime ? I know that I can clear the navigationbar and add the items again, but maybe there is a simple way to do it, is it ?

I have 3 topitems with sidebars (support, notifications, chat) and I want to update the text of each item with the number of unseen messages. Also I want to change the icon color of each item is this possible ?
 

Attachments

  • navbar_topitems.png
    navbar_topitems.png
    6.7 KB · Views: 255

alwaysbusy

Expert
Licensed User
Longtime User
I checked what is possible and what you ask should be doable. However, ONLY for the topbar items! (otherwise I will need to completely rewrite the navigation bar and frankly I don't have the time for this now).

I can write a method like this:
B4X:
page.NavigationBar.UpdateTopbarItemEx("LogOff", "mdi-action-delete" , "[" & counter & "]", ABM.COLOR_GREEN, ABM.INTENSITY_NORMAL)

If that is ok for you, add it in the feedback app and I look into it.

Also is there any way that I can make the Title font size smaller !?
This is already in the feedback app and will be handled in a future version.
 
Upvote 0

mindful

Active Member
Licensed User
I checked what is possible and what you ask should be doable. However, ONLY for the topbar items! (otherwise I will need to completely rewrite the navigation bar and frankly I don't have the time for this now).

I can write a method like this:
B4X:
page.NavigationBar.UpdateTopbarItemEx("LogOff", "mdi-action-delete" , "[" & counter & "]", ABM.COLOR_GREEN, ABM.INTENSITY_NORMAL)

If that is ok for you, add it in the feedback app and I look into it.


This is already in the feedback app and will be handled in a future version.

It will be just perfect ! I am already waiting for the next version :)
 
Upvote 0

mindful

Active Member
Licensed User
Also .. I encountered another problem ... I am adding a sidebartopcomponent (an abmcontainer) instead of the simple logo. This container has a user picture, the users name and also the account name.

The problem is that i create this item in the buildnavigationbar which is added to the navigation bar via the Initialize method. So how can I update this component in ConnectPage ? I keep all user variables in session which is not available in BuildPage.
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
I'll try to make the sidebartopcomponent accessible:

Could be something like:

B4X:
dim comp as ABMContainer = page.NavigationBar.SideBarTopComponent
' do your stuff with comp

comp.refresh

It will be just perfect ! I am already waiting for the next version
Please note that what is not in the feedback app will not be addressed. And I can't promise it will be all in the next version (but will probably be in the next major one like 2.10).

I'm currently working on the most urgent matters like rewriting the reconnect websocket code completely. This maintenance release will be available in the next weeks. And I'll see what new stuff I can fit in. ;)

EDIT: I just noticed you added it to the feedback app :)
 
Upvote 0
Top