I'm writing the last changes on v1.08. Still have to do some cleanup and updating the demo, but the release is near...
I got a couple of requests for the Navigation Bar since the first release. I've tried to make as little changes to the B4J code as possible for you, but still, there are some important ones.
e.g. the Initalize lost some params, and a couple are added.
1. The sidebar can now contain more complex menu items.
To do this a new method AddSideBarComponent() is introduced. In the screenshot below, it creates the menu items for mom, dad, etc...
Usage:
2. The 'logo' in the sidebar can be an ABMComponent too.
e.g. in this screenshot the top 'logo' is an ABMImage, some ABMLables and an ABMChart.
This does mean however in the page.NavigationBar.Initialize() method, you cannot longer pass just an image url but you have to create an ABMImage yourself. No big deal and it looks something like this to get the same effect:
3. Two new behaviours of the sidebar:
First, the sidebar can now be hidden on ALL devices, including the desktop:
Second, you can use the AUTO sidebar functionality. You can specify which top menu items should appear in the sidebar menu if you run it on mobile devices. Note: Using AUTO implies you cannot create a sidebar menu manually!
Best to show the effect of AUTO:
On the desktop notice the menu items in the right top corner, no hamburger icon:
Now on a mobile device, these items are gone and moved to the sidebar (image 1 shows the closed version with the hamburger icon, image 2 shows it open)
The code (one extra param to allow you to choose if the item should be moved on resizing):
So lots of new functionality and the changes are acceptable. We'll have to see how far the 'advanced' menu items will take us. I expect some controls just will not work, but the future will tell.
Cheers,
Alain
I got a couple of requests for the Navigation Bar since the first release. I've tried to make as little changes to the B4J code as possible for you, but still, there are some important ones.
e.g. the Initalize lost some params, and a couple are added.
1. The sidebar can now contain more complex menu items.
To do this a new method AddSideBarComponent() is introduced. In the screenshot below, it creates the menu items for mom, dad, etc...
Usage:
B4X:
page.NavigationBar.AddSideBarComponent("TestComp1", BuildSideBarComponent(page, "tcS1", "../images/mom.jpg", "Mom", "The loving one"), "")
2. The 'logo' in the sidebar can be an ABMComponent too.
e.g. in this screenshot the top 'logo' is an ABMImage, some ABMLables and an ABMChart.
This does mean however in the page.NavigationBar.Initialize() method, you cannot longer pass just an image url but you have to create an ABMImage yourself. No big deal and it looks something like this to get the same effect:
B4X:
Dim sbtopimg As ABMImage
sbtopimg.Initialize(page, "sbtopimg", logo, 1)
sbtopimg.SetFixedSize(236, 49)
page.NavigationBar.Initialize(page, "nav1", ABM.SIDEBAR_MANUAL_HIDEMEDIUMSMALL, Title, True, True, 330, 48, sbtopimg, ABM.COLLAPSE_ACCORDION, "nav1theme")
3. Two new behaviours of the sidebar:
First, the sidebar can now be hidden on ALL devices, including the desktop:
Second, you can use the AUTO sidebar functionality. You can specify which top menu items should appear in the sidebar menu if you run it on mobile devices. Note: Using AUTO implies you cannot create a sidebar menu manually!
Best to show the effect of AUTO:
On the desktop notice the menu items in the right top corner, no hamburger icon:
Now on a mobile device, these items are gone and moved to the sidebar (image 1 shows the closed version with the hamburger icon, image 2 shows it open)
The code (one extra param to allow you to choose if the item should be moved on resizing):
B4X:
page.NavigationBar.AddTopItem("Contact", "", "mdi-action-account-circle", "", False)
page.NavigationBar.AddTopItem("About", "About", "", "", True)
page.NavigationBar.AddTopItem("Themes", "Themes", "", "", True)
page.NavigationBar.AddTopSubItem("Themes", "Lightblue", "Light Blue", "", "")
page.NavigationBar.AddTopSubItem("Themes", "Orange", "Orange", "", "")
page.NavigationBar.AddTopSubItem("Themes", "Black", "Black", "", "")
page.NavigationBar.AddTopItem("Layouts", "Layouts", "", "",True)
So lots of new functionality and the changes are acceptable. We'll have to see how far the 'advanced' menu items will take us. I expect some controls just will not work, but the future will tell.
Cheers,
Alain