In ABMaterial 2.00, you will be able to define multiple side bars (sliding in from the right). I've tried to mimic the usage of ABMSideBar as much of the existing Side Navigation menu. The tricky part was making it work well with the NavigationBar, on all screensizes.
Note: Page_NavigationbarClicked() is NOT raised for such a sidebar!
Usage:
Make some Naviagtion bar themes. Note we disable the waveseffect because this looks ugly when we click on an item in the sidebar:
Now we can add the sidebars:
Here is the code for the component with some labels, an image and an ABMEditor
I'm rounding up the 2.00 release and it is scheduled to go out by the end of this week/early next week.
Note: Page_NavigationbarClicked() is NOT raised for such a sidebar!
Usage:
Make some Naviagtion bar themes. Note we disable the waveseffect because this looks ugly when we click on an item in the sidebar:
B4X:
' another navbar theme
MyTheme.AddNavigationBarTheme("nav2theme")
MyTheme.NavigationBar("nav2theme").SideBarWavesEffect = ABM.WAVESEFFECT_NONE
MyTheme.NavigationBar("nav2theme").SideBarBackColor = ABM.COLOR_BLUEGREY
MyTheme.NavigationBar("nav2theme").SideBarBackColorIntensity = ABM.INTENSITY_LIGHTEN4
' another navbar theme
MyTheme.AddNavigationBarTheme("nav3theme")
MyTheme.NavigationBar("nav3theme").SideBarWavesEffect = ABM.WAVESEFFECT_NONE
MyTheme.NavigationBar("nav3theme").SideBarBackColor = ABM.COLOR_LIME
MyTheme.NavigationBar("nav3theme").SideBarBackColorIntensity = ABM.INTENSITY_LIGHTEN4
' another navbar theme
MyTheme.AddNavigationBarTheme("nav4theme")
MyTheme.NavigationBar("nav4theme").SideBarWavesEffect = ABM.WAVESEFFECT_NONE
MyTheme.NavigationBar("nav4theme").SideBarBackColor = ABM.COLOR_TEAL
MyTheme.NavigationBar("nav4theme").SideBarBackColorIntensity = ABM.INTENSITY_LIGHTEN4
Now we can add the sidebars:
B4X:
Dim extraSideBar As ABMSideBar
extraSideBar.Initialize(page, "extrasidebar", 530, 48, 56, Null, ABM.COLLAPSE_ACCORDION, "nav2theme")
extraSideBar.AddSideBarComponent("esbHello", BuildSideBarComponent(page, "sidebarcomp", "../images2/16.jpg", "This is a sidebar component", "With an image and an editor"))
page.NavigationBar.AddTopItemWithSideBar("SideBar", "", "mdi-action-dashboard", "", False, extraSideBar)
Dim extraSideBar2 As ABMSideBar
extraSideBar2.Initialize(page, "extrasidebar2", 330, 48,56, Null, ABM.COLLAPSE_ACCORDION, "nav3theme")
extraSideBar2.AddSideBarDivider("")
extraSideBar2.AddSideBarItem("esbHello2", "Hello Again!", "mdi-action-invert-colors")
page.NavigationBar.AddTopItemWithSideBar("SideBar2", "", "mdi-action-dashboard", "", False, extraSideBar2)
Dim extraSideBar3 As ABMSideBar
extraSideBar3.Initialize(page, "extrasidebar3", 330, 48,56, Null, ABM.COLLAPSE_ACCORDION, "nav4theme")
extraSideBar3.AddSideBarDivider("")
extraSideBar3.AddSideBarItem("esbHello3", "Hello!", "mdi-action-invert-colors")
page.NavigationBar.AddTopItemWithSideBar("SideBar3", "", "mdi-action-dashboard", "", False, extraSideBar3)
Here is the code for the component with some labels, an image and an ABMEditor
B4X:
Sub BuildSideBarComponent(page As ABMPage, id As String, image As String, Title As String, Subtitle As String) As ABMContainer 'ignore
Dim ItemCont As ABMContainer
ItemCont.Initialize(page, id, "")
ItemCont.AddRowsM(1,False,0,0, "").AddCellsOSMP(1,0,0,0,3,3,3,4,0,0,0,"").AddCellsOSMP(1,0,0,0,9,9,9,4,0,0,0,"")
ItemCont.AddRowsM(1,False,0,0, "").AddCells12(1, "")
ItemCont.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
Dim SubItemCont As ABMContainer
SubItemCont.Initialize(page, id & "SubItemCont", "")
SubItemCont.AddRowsM(1,False, 0,0,"").AddCells12MP(1,-6,0,0,0,"").AddCells12(1,"")
SubItemCont.BuildGrid 'IMPORTANT once you loaded the complete grid AND before you start adding components
ItemCont.Cell(1,2).AddComponent(SubItemCont)
Dim img As ABMImage
img.Initialize(page, id & "img", image, 1)
img.SetFixedSize(48,48)
img.IsCircular = True
img.IsResponsive = True
ItemCont.Cell(1,1).AddComponent(img)
Dim lbl1 As ABMLabel
lbl1.Initialize(page, id & "lbl1", Title, ABM.SIZE_H6, False, "lightblue")
lbl1.VerticalAlign = True
SubItemCont.Cell(1,1).AddComponent(lbl1)
Dim lbl2 As ABMLabel
lbl2.Initialize(page, id & "lbl2", Subtitle, ABM.SIZE_H6, False, "")
lbl2.VerticalAlign = True
SubItemCont.Cell(1,2).AddComponent(lbl2)
Dim editor As ABMEditor
editor.Initialize(page, "editor", True, True, "editor")
ItemCont.Cell(2,1).AddComponent(editor)
Return ItemCont
End Sub
I'm rounding up the 2.00 release and it is scheduled to go out by the end of this week/early next week.