Android Question B4XPages Drawer

mscientist33

Active Member
Licensed User
I am in need of the same answer of the question that was asked here: B4XPages Drawer

His answer was never answered and the thread was closed....

I need the Drawer to be on the MainPage and accessible on all the other pages, preferably without having to duplicate code on each page.
 

jahswant

Well-Known Member
Licensed User
Longtime User
I need the Drawer to be on the MainPage and accessible on all the other pages, preferably without having to duplicate code on each page.
You will need to create an instance in each page for cross platform projects. Definitely.
 
Upvote 0

mscientist33

Active Member
Licensed User
I have tried moving the Drawer code from page2 to the mainpage from this example: B4XPages + B4XDrawers

I get this error: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ata.devo.ACToolbarLightWrapper" on path: DexPathList[[zip file "/mnt/expand/cf81e24b-b56f-473a-a2e5-c66313ee3f4c/app/com.ata.devo-1/base.apk"],nativeLibraryDirectories=[/mnt/expand/cf81e24b-b56f-473a-a2e5-c66313ee3f4c/app/com.ata.devo-1/lib/arm64, /system/lib64, /vendor/lib64]]

The B4XPages + B4XDrawers runs fine as an example program....
 
Upvote 0

Blueforcer

Well-Known Member
Licensed User
Longtime User
Quite easy:
B4X:
Sub Globals
    Private drawer As B4XDrawer
End Sub

Sub Activity_Create(FirstTime As Boolean)
    drawer.Initialize(Me,"drawer",Activity,30%x)
    Dim pm As B4XPagesManager
    pm.Initialize(drawer.CenterPanel)
    drawer.LeftPanel.LoadLayout("Sidebar")
End Sub
with this all pages will be rendered in the drawers centerpanel and not in the whole activity
 
Upvote 0

mscientist33

Active Member
Licensed User
So for B4X pages does this go in the "Main" or "B4XMainPage"? Only "Main" has the Activity_Create so I am assuming it goes there?
 
Upvote 0

mscientist33

Active Member
Licensed User
Works fine @Blueforcer but I need the "hamburger" icon in the Titlebar. I have an open question here: B4X Drawers. I really like the way the example works and that is what I want but it is for Activities instead of B4X pages. Is there any good documentation on converting Activities to B4X? I've come across a lot of good stuff and examples of good stuff but mostly for Activities.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…