def __init__(self, **kwargs):
     super(LayoutsApp, self).__init__(**kwargs)
     self.NDrawer = MDNavigationDrawer()
     self.Screen1 = MDFloatLayout()
     self.BLay = BoxLayout()
     self.MDTool = MDToolbar()
     self.Widgy = Widget()
     self.NLayout = NavigationLayout()
     self.CNDrawer = ContentNavigationDrawer()
     return
class LayoutsApp(MDApp):

    ###################################
    def __init__(self, **kwargs):
        super(LayoutsApp, self).__init__(**kwargs)
        self.NDrawer = MDNavigationDrawer()
        self.Screen1 = MDFloatLayout()
        self.BLay = BoxLayout()
        self.MDTool = MDToolbar()
        self.Widgy = Widget()
        self.NLayout = NavigationLayout()
        self.CNDrawer = ContentNavigationDrawer()
        return

    ###################################
    def My_Callback(self, instance):
        self.NDrawer.set_state('toggle')
        return

    ###################################
    def build(self):
        ###############################
        self.Screen1.size = Window.size
        self.NLayout.size = self.Screen1.size
        self.NLayout._scrim_color = Color(
            rgba=[0, 0, 0, 0])  # Necessary to avoid Exception
        self.BLay.size = self.Screen1.size
        self.BLay.orientation = 'vertical'
        self.MDTool.title = 'Navigation Drawer'
        self.MDTool.elevation = 10
        self.MDTool.left_action_items = [['menu', self.My_Callback]]
        ###############################
        if (self.MDTool.parent == None):
            self.BLay.add_widget(self.MDTool)
        if (self.Widgy.parent == None):
            self.BLay.add_widget(self.Widgy)
        if (self.BLay.parent == None):
            self.Screen1.add_widget(self.BLay)
        if (self.CNDrawer.parent == None):
            self.NDrawer.add_widget(self.CNDrawer)
        if (self.NDrawer.parent == None):
            self.NLayout.add_widget(self.NDrawer)
        if (self.NLayout.parent == None):
            self.Screen1.add_widget(self.NLayout)
        ###############################
        LayoutsApp.title = 'Navigation Drawer'
        self.CNDrawer.Initialize()
        return self.Screen1
Exemplo n.º 3
0
class MCRM(MDApp):
    # def on_start(self):
    #     self.root.ids.dashtoolbar.ids.label_title.font_style = 'Button' #AttributeError: 'NoneType' object has no attribute 'ids'

    def build(self):
        self.theme_cls.primary_palette = 'Teal'
        self.theme_cls.primary_hue = '700'
        self.theme_cls.theme_style = 'Dark'

        self.screen = Builder.load_string(code_layout)
        self.navlayout = NavigationLayout()
        self.screenmanager = ScreenManager()
        self.screenmanager.id = 'screenmanager'
        self.screenmanager.add_widget(DashboardScreen(name='dashboard'))
        self.screenmanager.add_widget(ListLeadsScreen(name='listleads'))
        self.screenmanager.add_widget(ListAccountsScreen(name='listaccounts'))
        self.navdrawer = Builder.load_string(nav_drawer)
        self.navdrawer.id = 'navdrawer'
        self.navlayout.add_widget(self.screenmanager)
        self.navlayout.add_widget(self.navdrawer)
        self.footer = Builder.load_string(code_footer)
        self.screen.add_widget(self.navlayout)
        self.screen.add_widget(self.footer)
        return self.screen

    def close_navigation(self):
        if self.navdrawer.state == 'open':
            self.navdrawer.set_state()

    def display_navigation(self):
        self.navdrawer.set_state()

    def showdashboard(self):
        print('Dashboard')
        self.screenmanager.current = 'dashboard'
        self.close_navigation()

    def showleads(self):
        print('Leads')
        self.screenmanager.current = 'listleads'
        self.close_navigation()

    def showaccounts(self):
        print('Accounts')
        self.screenmanager.current = 'listaccounts'
        self.close_navigation()
Exemplo n.º 4
0
    def build(self):
        self.theme_cls.primary_palette = 'Teal'
        self.theme_cls.primary_hue = '700'
        self.theme_cls.theme_style = 'Dark'

        self.screen = Builder.load_string(code_layout)
        self.navlayout = NavigationLayout()
        self.screenmanager = ScreenManager()
        self.screenmanager.id = 'screenmanager'
        self.screenmanager.add_widget(DashboardScreen(name='dashboard'))
        self.screenmanager.add_widget(ListLeadsScreen(name='listleads'))
        self.screenmanager.add_widget(ListAccountsScreen(name='listaccounts'))
        self.navdrawer = Builder.load_string(nav_drawer)
        self.navdrawer.id = 'navdrawer'
        self.navlayout.add_widget(self.screenmanager)
        self.navlayout.add_widget(self.navdrawer)
        self.footer = Builder.load_string(code_footer)
        self.screen.add_widget(self.navlayout)
        self.screen.add_widget(self.footer)
        return self.screen
Exemplo n.º 5
0
    def __init__(self, **kwargs):
        super(Mainnavscreen, self).__init__(**kwargs)

        global Mdnavigationdrawer
        navigationLayout = NavigationLayout()
        Containor = ScreenManager()
        Containor.add_widget(Main())
        navigationLayout.add_widget(Containor)

        Mdnavigationdrawer = MDNavigationDrawer()
        box = BoxLayout(orientation='vertical')
        box.add_widget(
            Button(background_normal="Pictures/banner.webp",
                   size_hint=(1, None),
                   size=(0, Window.height * 0.5)))
        Drawer_list = {
            "star": "Starred",
            "settings": "Settings",
            "bookmark": "Rate & Share"
        }
        for i, j in Drawer_list.items():
            Item = TwoLineIconListItem(text=str(j))
            Item.add_widget(IconLeftWidget(icon=str(i)))
            Item.bind(on_release=self.list_action)
            box.add_widget(Item)
        box.add_widget(ScrollView())
        Mdnavigationdrawer.add_widget(box)

        navigationLayout.add_widget(Mdnavigationdrawer)

        self.add_widget(navigationLayout)
Exemplo n.º 6
0
 def build(self):
     nav_lay = NavigationLayout()
     nav_drawer = MDNavigationDrawer()
     nav_drawer.add_widget(ContentNavigationDrawer())
     sm = ScreenManager()
     sm.add_widget(MainScreen(name='main_menu', nav_drawer=nav_drawer))
     sm.current = 'main_menu'
     nav_lay.add_widget(sm)
     nav_lay.add_widget(nav_drawer)
     return nav_lay
Exemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     NavigationLayout.__init__(self, *args, **kwargs)
     self._panel_disable = True
Exemplo n.º 8
0
    def __init__(self, *args, **kwargs):
        NavigationLayout.__init__(self, *args, **kwargs)
        self._panel_disable = True

        Clock.schedule_once(self.check_logged)
Exemplo n.º 9
0
    def build(self):
        app = MDApp.get_running_app()
        app.theme_cls = ThemeManager()
        app.theme_cls.primary_palette = "DeepPurple"
        app.theme_cls.accent_palette = "DeepPurple"
        app.theme_cls.theme_style = "Light"
        Window.borderless = False
        self.title = "Super Chat"
        Config.set('kivy', 'window_title', 'Super Chat')

        self.root_sm = ScreenManager()
        rscreen = Screen(name="Root")

        self.nav_layout = NavigationLayout()
        self.nl_sm = ScreenManager()
        nl_screen = Screen(name="nl")
        self.toolbar = MDToolbar(pos_hint={'top': 1},
                                 elevation=9, title=chat_app.title, md_bg_color=chat_app.theme_cls.primary_color)
        self.toolbar.left_action_items = [
            ["menu", lambda x: self.nav_drawer.toggle_nav_drawer()]]
        nl_screen.add_widget(self.toolbar)
        self.screen_manager = ScreenManager()

        self.connect_page = ConnectPage()
        screen = Screen(name="Connect")
        screen.add_widget(self.connect_page)
        self.screen_manager.add_widget(screen)

        self.info_page = InfoPage()
        screen = Screen(name="Info")
        screen.add_widget(self.info_page)
        self.screen_manager.add_widget(screen)
        nl_screen.add_widget(self.screen_manager)
        self.nl_sm.add_widget(nl_screen)

        self.nav_drawer = MDNavigationDrawer(elevation=0)

        self.ndbox = BoxLayout(orientation="vertical", spacing="8dp")

        self.avatar = Image(id="avatar", size_hint=(None, None), size=(
            Window.size[0]*0.65, Window.size[0]*0.55), source="icon.png")
        self.anchor = AnchorLayout(
            anchor_x="center", size_hint_y=None, height=self.avatar.height*1.3)
        self.anchor.add_widget(MDLabel())
        self.anchor.add_widget(self.avatar)
        self.ndbox.add_widget(self.anchor)

        self.fl = FloatLayout()
        self.fl.padding = 8
        self.sub_nav = OneLineAvatarIconListItem(text="Settings", theme_text_color="Primary", pos_hint={
                                                 'center_x': 0.5, 'center_y': 1}, font_style="Button")
        self.iconitem = IconLeftWidget(icon="settings", pos_hint={
                                       'center_x': 1, 'center_y': 0.55})
        self.sub_nav.add_widget(self.iconitem)
        self.fl.add_widget(self.sub_nav)
        self.settings_btn = OneLineAvatarIconListItem(
            text="Dark Mode", on_press=self.theme_change,on_release=lambda x: self.nav_drawer.toggle_nav_drawer(), pos_hint={'center_x': 0.5, 'center_y': 0.86})
        self.iconitem = IconLeftWidget(
            icon="theme-light-dark", pos_hint={'center_x': 1, 'center_y': 0.55})
        self.settings_btn.add_widget(self.iconitem)
        self.fl.add_widget(self.settings_btn)
        self.ndbox.add_widget(self.fl)
        self.toolbar = MDToolbar(
            elevation=8, title=chat_app.title, md_bg_color=chat_app.theme_cls.primary_color)
        self.toolbar.left_action_items = [
            ["close", sys.exit]]
        self.ndbox.add_widget(self.toolbar)
        self.nav_drawer.add_widget(self.ndbox)
        self.nav_layout.add_widget(self.nl_sm)
        self.nav_layout.add_widget(self.nav_drawer)

        rscreen.add_widget(self.nav_layout)
        self.root_sm.add_widget(rscreen)

        return self.root_sm