B4J Question [ABMaterial] NavigationBar "complex" Logo

Cableguy

Expert
Licensed User
Longtime User
From one very old post one reads...

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.



I would like to create "Something" similar to this "complex" Logo, but I can't figure it out...
Should I ceate a 1R container, stuff it all and reference it to the NavBar?

Alain, please, a snippet?
 

Harris

Expert
Licensed User
Longtime User
Good question, since all I see is the "logo" as string (source of image).
Can't see how to add it as a component.
 
Upvote 0

Harris

Expert
Licensed User
Longtime User


I am sure @alwaysbusy will help you out, when he gets Round Tuit...

Here is my offering of such...
We all need one or two of these... They are free and easily passed along to others who need them.

Using up one of these is the hardest part... Yet we shall all - get around to it...

Also, @Cableguy , we hope you shall update the dummies tutorial with all your new found knowledge. This will benefit all that follow you - trying to grasp the "little" things that are not known or documented (in ABM). You help all of us so much elsewhere with your intellect, so this is a natural progression in how you contribute.

Thanks
 
Last edited:
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
From one of my apps, same principle in BuildNavigationBar:

B4X:
   Dim sbtopcont As ABMContainer
   sbtopcont.Initialize(page, "sbtopcont", "")
   sbtopcont.AddRowsM(1, True, 0,0,"").AddCells12MP(1,0,-19,0,0, "")
   sbtopcont.AddRowsM(1, True, 0,10,"").AddCells12(1, "")
   sbtopcont.BuildGrid
   
   Dim sbtopimg As ABMImage
   sbtopimg.Initialize(page, "sbtopimg", logo, 1)
   Dim tmpLogo As String = logo.Replace("../images/logo", "").Replace(".png", "")
   Dim spl() As String
   spl = Regex.Split("x", tmpLogo)
   Dim logoX As Int = spl(0)
   Dim logoY As Int = spl(1)
   sbtopimg.SetFixedSize(logoX, logoY)   
   sbtopcont.Cell(1,1).AddComponent(sbtopimg)
   
   Dim lblLoggedIn As ABMLabel
   lblLoggedIn.Initialize(page, "lblLoggedIn", "{NBSP}", ABM.SIZE_H6, False, "centerWhite")
   lblLoggedIn.Clickable = True
   sbtopcont.Cell(2,1).AddComponent(lblLoggedIn)
   
   logoY = logoY + 30
   
   page.NavigationBar.Initialize(page, "nav1", ABM.SIDEBAR_MANUAL_HIDEMEDIUMSMALL, Title, True, True, 300, 48, sbtopcont, ABM.COLLAPSE_ACCORDION, "onetwo")
   page.NavigationBar.TopBarHeightPx = 56
   page.NavigationBar.SideBarLogoHeight = logoY
   page.NavigationBar.ActiveTopReturnName = ActiveTopReturnName
   page.NavigationBar.ActiveSideReturnName = ActiveSideReturnName
   page.NavigationBar.ActiveSideSubReturnName = ActiveSideSubReturnName
   page.NavigationBar.IsTextSelectable = False
   page.NavigationBar.SideBarSubItemsArrowAlignRight = True

There is a catch. On mobiles, for the moment you can not use any inputs that call up the virtual keyboard. Some bug in Materialize CSS closes the sidebar as soon as the keybaord comes up. On desktop they are not a problem.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Thanks for the praise words.. sometimes I get the feeling that you all credit me more than I deserve...
I am planning on doing a series on Theming... There are a lot of theme options that we don't even know what they are for, and the inline context help... Well, doesn't help.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User

THIS IS SORCERIE!!!!

Please, can you explain how how earth you get the size of the image from the image url? I see HOW but I can't UNDERSTAND the process!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…