Hello together,
im struggeling for days solving my problem.
I really want to use B4Xpages, because its easier to keep the views when the app is rotating/resizing.
The Maingoal is to have a app framework like the picture below.
So the header and sidebar is static and the B4XPages are rendered in the content panel
The Sidebar is made with the B4XDrawer.
Try 1:
Load the layout in the activity with b4xdrawer and header, and initialize the B4XPagesManager with the ContentPanel
Advantages:
Try 2:
Building a class wich contains the whole framework and instanciate and place it to every singe B4Xpage
Advantages:
As you can see, i tried the only both variants i could find here in the forum.
But im not happy with any of the results.
Does anyone knows a even better way to reach my goal?
i really appreciate any of your help
im struggeling for days solving my problem.
I really want to use B4Xpages, because its easier to keep the views when the app is rotating/resizing.
The Maingoal is to have a app framework like the picture below.
So the header and sidebar is static and the B4XPages are rendered in the content panel
The Sidebar is made with the B4XDrawer.
You need to know:
The GUI is mainly generated dynamically by a json at the start of the application. This json sets all the sidebar items, theme, content of each b4xpage and so on.
Also my custom backend is genereated by json. For example logics, hardwarebus and so on.
The App will run on an industrial panel and will act as a PLC to control a bunch of busdriven devices for watertreatment and electrolysis. So its very important that the app will always run for 100%, even if the app is in the background or changing the orientation.
Try 1:
Load the layout in the activity with b4xdrawer and header, and initialize the B4XPagesManager with the ContentPanel
One B4XDrawer over several B4XPages
Is there a way to use only one B4Xdrawer for all pages? Like an Layer over all Pages. I want to have one sidebar where i can switch to different screens. Right now there are some points wich i find unattractive: - I need to create a new drawer for every page - I need to setback the drawer...
www.b4x.com
Advantages:
- The Sidebar and Header is always visible and instanced only once
- I can switch the B4XPage by choose one from the sidebar, without breaking the user experience (New page shown up in the background, after some millisecons the sidebar closes animated.
- If i rotate the phone, it destroys all the views in the main activity, and need to setup again. This would destroy several classes( (for example some intelligent in the header) wich needs working in the background all the time, without too loose it for a short time. Also the Sidebar is destroyed and needs to build up again (this is not a layout, its generated from a json). Also all the color theming is gone and need to set again
Try 2:
Building a class wich contains the whole framework and instanciate and place it to every singe B4Xpage
B4XPages Drawer
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.
www.b4x.com
Advantages:
- All views, and classes are kept at anytime
- The intelligent views are running multiple times, but they shouldn't. wich could cause a much higher RAM usage as needed for some classes.
- The B4XDrawer removes immediately when you call a new b4xpage. This doesnt look nice
- You need to parse all current states of the sidebar to every b4xpage in order to keep the highlighted Item etc.
As you can see, i tried the only both variants i could find here in the forum.
But im not happy with any of the results.
Does anyone knows a even better way to reach my goal?
i really appreciate any of your help
Last edited: