Kivy Navigation Bar and Multiple Screens Example (no .kv file)
Kivy ScreenManager and MDNavigationDrawer (without .kv file)
This documentation compliments another article done with mostly kv language here.
This application is intended to be the framework for an application that will have a login screen(ParentScreen1) that leads to another set of screens with a navigation. Once user logs in correctly currently, just a button. They are directed to another screen which is the screen that hosts the rest of the application (ParentScreen2).
ParentScreen2 contains a BoxLayout (containing screemanager (csm) and MDToolbar) and a MDNavigationDrawer (nav_drawer). This is where most of application will function.
To help visualize the structure here is a diagram:
ScreenManager(psm) <--initialized in MainApp()
├── ParentScreen1(ps1)
│ └── Boxlayout(box1)
│ ├── Label (used add_widgete directly)
│ └──Button (button1, function changes ps1 to ps2)
└── ParentScreen2(ps2)
├── BoxLayout (super_box)
│ ├── MDToolbar(toolbar)
│ └── ScreenManager (csm)
│ ├──ChildScreen1(cs1)
│ └──ChildScreen2(cs2)
└── MDNavigationDrawer(nav_drawer)
└── Boxlayout (nav_box)
├──Button(nav_button1, function changes cs1 to cs2)
└──Button(nav_button2, function changes cs2 to cs1)
main.py