B4J Question ABMaterial - Top Bar Forbidden Space

mmieher

Active Member
Licensed User
Longtime User
I cannot figure out what is to the right of the Title string when displayed on smaller devices. It sure looks like there is lots of real estate over there?
B4X:
    Dim str As String = "Pearl Necklace Media"
    ABMShared.BuildNavigationBarEx(page, str,"../images/logo-blank-330x117.png",  "", "", "", True)    '    IP parm = "is phone"

1674433586282.png


B4X:
Sub BuildNavigationBarEX(page As ABMPage, Title As String, logo As String, ActiveTopReturnName As String, ActiveSideReturnName As String, ActiveSideSubReturnName As String, ip As Boolean)
        LogColor("BuildNavigationBarEX", clrLog)
    '    mhm this image can be an ABMComponent
    Dim sbtopimg As ABMImage
    sbtopimg.Initialize(page,  "sbtopimg",  logo, 1)
    sbtopimg.SetFixedSize( 330, 117)
    page.NavigationBar.Initialize(page, "nav21",  ABM.SIDEBAR_MANUAL_ALWAYSHIDE, Title, True,  True, 300, 48, sbtopimg, ABM.COLLAPSE_ACCORDION, "nav1theme")

    ' CLEAR any existing items....
    page.NavigationBar.Clear
    ''''page.PaddingBottom = 100    '    padding at the bottom of what?  page i guess
    
    page.NavigationBar.ActiveTopReturnName = ActiveTopReturnName
    page.NavigationBar.ActiveSideReturnName = ActiveSideReturnName
    page.NavigationBar.ActiveSideSubReturnName = ActiveSideSubReturnName

    'page.NavigationBar.AddTopItem("Help",  "Help", "mdi-action-help",  "../AboutPage",  False)
    'page.NavigationBar.AddTopItem("LogOff",  "Log Off", "mdi-action-exit-to-app",  "",  False)
    
    '    **********************************************************************************************************
    '    i do not see this on page but without this line the menu Hamburger does not appear
'''' SIDEBAR!   page.NavigationBar.AddSideBarItem( "About",   "About / Help", "mdi-communication-live-help",  "../AboutPage")    '    this ? in speech bubble is nowhere to be found
'    page.NavigationBar.AddSideBarItem( "About",   "About / Help", "mdi-communication-live-help", "../AboutPage")
'    page.NavigationBar.AddSideBarDivider '("")
'   page.NavigationBar.AddSideBarItem("Cases", "Manage Issues", "mdi-action-dashboard", "../OverviewCasesPage")
'   page.NavigationBar.AddSideBarDivider '("")
    
   ' ****************** Here we build the extra content container. ***************************
    ''''Dim pad As Int = 5
    ''''Dim hd As Int = 15
    ''''page.NavigationBar.InitializeExtraContent("extracontent", False, "")
    ' dummy row - may be used later...
    ''''page.NavigationBar.ExtraContent.AddRowsM(1,True,0,0 ,"").AddCellsOSMP(1,0,0,0,12,12,12,0,0,20,20,"")
    ' the actual row to contain our components...
    ''''page.NavigationBar.ExtraContent.AddRowsM2(   1,  Not(ip),  0, 0,pad,pad, "rowtheme2").AddCellsOSMP( 1, 0,0,0,  12,6,3, 0,0,0,0,"cellcntr").AddCellsOSMP(1,0,0,0, 12,6,3,0,0,0,0,"cellcntr").AddCellsOSMP(1,0,0,0, 12,6,3, hd, hd,0,0,"cellcntr").AddCellsOSMP(1,  0,0,0, 12,6,3, hd,  hd,0,0,"cellcntr")
    ' another dummy row...
    ''''page.NavigationBar.ExtraContent.AddRowsM(1,True,0,0,"").AddCellsOSMP(  1,0,0,0, 12,12,12, 0,40,20,20,"")
    ' BUILD IT!
    ''''page.NavigationBar.ExtraContent.BuildGrid
    ' add the half button... up/down arrow thing
    ''''page.NavigationBar.InitializeExtraHalfButton("ExtraButton", "fa fa-arrows-v", ABM.BUTTONSIZE_NORMAL, ABM.HALFBUTTON_RIGHT, "btnamber")
    ' END EXTRA CONTENT ***********************************************************************
 
    page.DebugPrintGrid
End Sub
 

Harris

Expert
Licensed User
Longtime User
Try fiddling with these params.. ( ABM.SIDEBAR_MANUAL_HIDEMEDIUMSMALL ) for example.
The area in question is used for NavigationBar top items... One would "think" with no top item added, then the space would become available for the Title - but seems reserved in the original framework. One can always abbreviate the title when on small devices - as a work around.

@alwaysbusy had addressed this issue previously, as I recall... The result I don't recall however - search for it (endlessly).

B4X:
    If SmallDevice(page) Then
        page.NavigationBar.Initialize(page, "nav21",  ABM.SIDEBAR_MANUAL_HIDEMEDIUMSMALL, Title,  True,  True, 300,  48, sbtopimg, ABM.COLLAPSE_ACCORDION, "nav1theme")
    Else
        page.NavigationBar.Initialize(page, "nav21",   ABM.SIDEBAR_MANUAL_ALWAYSHIDE, Title,  True,  True, 300, 48, sbtopimg, ABM.COLLAPSE_ACCORDION, "nav1theme")
    End If
    page.NavigationBar.Clear

' ....

    If SmallDevice(page) Then
        If Not(page.IsPhone) Then
            page.NavigationBar.AddTopItem("Help",  "", "mdi-action-help",  "../AboutPage",   False)
        End If    
        page.NavigationBar.AddTopItem("LogOff",  "", "mdi-action-exit-to-app",  "",  False)
    Else
        page.NavigationBar.AddTopItem("Help",  "Help", "mdi-action-help",  "../AboutPage",  False)
        page.NavigationBar.AddTopItem("LogOff",  "Log Off", "mdi-action-exit-to-app",  "",  False)
    End If
 
Upvote 0
Top