B4J Question [ABMaterial] Navigationbar Active Foreground Color didn't change

incendio

Well-Known Member
Licensed User
Longtime User
Hello guys,

I have module named About, here are the code for BuildPage
B4X:
public Sub BuildPage()
    BuildTheme    
    page.InitializeWithTheme(Name, "/ws/" & ABMShared.AppName & "/" & Name, False, ABMShared.SessionMaxInactiveIntervalSeconds, theme)
    page.ShowLoader=True
    page.PageTitle = "About"
    page.PageHTMLName = "about.html"
       
    page.ShowConnectedIndicator = True
           
    ABMShared.BuildNavigationBar(page, "Web APP","../images/logo.png", "", "", "")
           
    page.AddRowsM(1,True,0,0, "").AddCells12MP(1,0,0,0,0,"")
    page.BuildGrid 
End Sub

On module ABMApplication, here is the declaration to point to that page
B4X:
Sub Class_Globals
    Private InitialPage As String = "About/about.html"  
End Sub

On module ABMShared, here are the codes in BuildTheme for ActiveForeColor
B4X:
Sub BuildTheme(themeName As String)
    MyTheme.Initialize(themeName)
   
    MyTheme.AddNavigationBarTheme("nav1theme")    MyTheme.NavigationBar("nav1theme").SideBarActiveForeColor = ABM.COLOR_AMBER
    MyTheme.NavigationBar("nav1theme").SideBarSubActiveForeColor = ABM.COLOR_AMBER
    MyTheme.NavigationBar("nav1theme").SideBarSubActiveForeColorIntensity = ABM.INTENSITY_DARKEN3
End Sub
On module ABMApplication, here are the codes in BuildNavigationBar
B4X:
Sub BuildNavigationBar(page As ABMPage, Title As String, logo As String, ActiveTopReturnName As String, ActiveSideReturnName As String, ActiveSideSubReturnName As String)     'ignore
    Dim sbtopimg As ABMImage
    Private Wdth = 250 As Int
   
    page.NavigationBar.Initialize(page, "nav1", ABM.SIDEBAR_MANUAL_ALWAYSHIDE, Title, True, True, Wdth, 49, sbtopimg, ABM.COLLAPSE_ACCORDION, "nav1theme")
    page.NavigationBar.IsTextSelectable = False
    page.NavigationBar.TopBarDropDownConstrainWidth = False
    page.NavigationBar.ActiveTopReturnName = ActiveTopReturnName
    page.NavigationBar.ActiveSideReturnName = ActiveSideReturnName
    page.NavigationBar.ActiveSideSubReturnName = ActiveSideSubReturnName

    page.NavigationBar.AddSideBarDivider
    page.NavigationBar.AddSideBarItem("About", "About", "mdi-action-dashboard", "../About/about.html")
End Sub

But Sidebar Item Active foreground color didn't change to color amber.

s.jpg

It seem that About Page is not active, so the color didn't change, where did I miss?
 
Top