Esempio n. 1
0
    def build(self):

        #Build root widget, that is the core application or interface

        self.theme_cls.primary_palette = 'Green'

        screen = Screen()
        #Create a screen variable and add elements to the Screen to display them

        btn_num = MDRectangleFlatButton(text='Enter',
                                        pos_hint={
                                            'center_x': 0.5,
                                            'center_y': 0.65
                                        },
                                        on_release=self.get_data_num)
        screen.add_widget(btn_num)

        btn_sms = MDRectangleFlatButton(text='Enter',
                                        pos_hint={
                                            'center_x': 0.5,
                                            'center_y': 0.45
                                        },
                                        on_release=self.get_data_sms)
        screen.add_widget(btn_sms)

        self.num = Builder.load_string(num_helper)
        screen.add_widget(self.num)

        self.sms = Builder.load_string(sms_helper)
        screen.add_widget(self.sms)

        return screen
    def __init__(self, product, MDlist, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.title = f"{product.name}"
        self.MDlist = MDlist
        self.product = product
        self.size_hint = (0.7, 0.9)

        layout = BoxLayout()
        layout.orientation = "vertical"

        layout.add_widget(
            Label(text=f"Product: {product.name}", size_hint=(1, 0.3)))
        layout.add_widget(
            Label(text=f"Cost: £{round(product.cost, 2)}", size_hint=(1, 0.3)))

        scroll = ScrollView()
        self.Mlist = MDList()
        self.build_list()

        scroll.add_widget(self.Mlist)
        layout.add_widget(scroll)

        btn_layout = BoxLayout(size_hint=(1, 0.3))
        btn_layout.add_widget(
            MDRectangleFlatButton(text="Return", on_release=self.dismiss))
        btn_layout.add_widget(
            MDRectangleFlatButton(text="Discard",
                                  on_release=self.discard_product))
        layout.add_widget(btn_layout)
        self.content = layout
 def build(self):
     self.theme_cls.primary_pallet = "Green"
     self.theme_cls.theme_style = "Dark"
     screen = Screen()
     icon2 = MDIconButton(icon="file-upload-outline",
                          pos_hint={'center_x': 0.8, 'center_y': 0.7}, on_release=self.example_fun)
     top = Builder.load_string(ttop)
     l2 = MDLabel(text="Scan File", pos=(40, 178), font_style="Body2", theme_text_color="Primary")
     self.f = Builder.load_string(us)
     l4 = MDRectangleFlatButton(text="Update", pos_hint={'center_x': 0.747, 'center_y': 0.2},
                                size_hint=(None, None),
                                width=5, height=2, on_release=self.update)
     toptoolbar = Builder.load_string(tt)
     bt1 = MDRectangleFlatButton(text='Scan', pos_hint={'center_x': 0.4, 'center_y': 0.6}, size_hint=(None, None),
                                 width=5, height=2, on_release=self.start_scan)
     bt2 = MDRectangleFlatButton(text='Delete', pos_hint={'center_x': 0.74, 'center_y': 0.6}, size_hint=(None, None),
                                 width=5, height=2, on_release=self.delete_infected)
     screen.add_widget(toptoolbar)
     screen.add_widget(l2)
     screen.add_widget(self.f)
     screen.add_widget(l4)
     screen.add_widget(bt1)
     screen.add_widget(bt2)
     screen.add_widget(top)
     screen.add_widget(icon2)
     return screen
Esempio n. 4
0
File: main.py Progetto: n-gras/XCalc
    def build(self):
        self.operators = ["^", " / ", " * ", " + ", " - "]
        # operators /,*,+,- are added with leading and trailing space to make
        # identification possible between that and negative numbers
        self.last_was_operator = None
        self.last_button = None
        main_layout = MDBoxLayout(orientation="vertical")
        self.solution = MDTextFieldRect(multiline=False,
                                        readonly=True,
                                        size_hint=[1, None],
                                        halign="right",
                                        height="80sp",
                                        font_size='55sp')
        main_layout.add_widget(self.solution)
        buttons = [["", "C", "<-", "^"], ["", "", "", " / "],
                   ["7", "8", "9", " * "], ["4", "5", "6", " - "],
                   ["1", "2", "3", " + "], ["+/-", "0", ".", "="]]
        for row in buttons:
            h_layout = MDBoxLayout()
            for label in row:
                button = MDRectangleFlatButton(text=label,
                                               pos_hint={
                                                   "center_x": 0.5,
                                                   "center_y": 0.5
                                               },
                                               size_hint=(1, 1),
                                               font_size='20sp')
                button.bind(on_press=self.on_button_press)
                h_layout.add_widget(button)
            main_layout.add_widget(h_layout)

        return main_layout
Esempio n. 5
0
 def info_popup(self):
     """popup to display more information about selection"""
     if self.polarity == None:
         record = Material.get_material(self.name)
         self.dialog = MDDialog(
             title=record['material_name'],
             type='custom',
             content_cls=MaterialInfo(),
             buttons=[
                 MDRectangleFlatButton(
                     text="Okay",
                     on_release=lambda x: self.dialog.dismiss())
             ])
     else:
         record = Solvent.get_solvent(self.name)
         self.dialog = MDDialog(
             title=record['solvent_name'],
             type='custom',
             content_cls=SolventInfo(),
             buttons=[
                 MDRectangleFlatButton(
                     text="Okay",
                     on_release=lambda x: self.dialog.dismiss())
             ])
     for key in record:
         setattr(self.dialog.content_cls, key, record[key])
     self.dialog.open()
Esempio n. 6
0
    def build(self):

        self.theme_cls.primary_palette = 'Green'

        screen = Screen()

        btn_num = MDRectangleFlatButton(text='Enter',
                                        pos_hint={
                                            'center_x': 0.5,
                                            'center_y': 0.65
                                        },
                                        on_release=self.get_data_num)
        screen.add_widget(btn_num)

        btn_sms = MDRectangleFlatButton(text='Enter',
                                        pos_hint={
                                            'center_x': 0.5,
                                            'center_y': 0.45
                                        },
                                        on_release=self.get_data_sms)
        screen.add_widget(btn_sms)

        self.num = Builder.load_string(num_helper)
        screen.add_widget(self.num)

        self.sms = Builder.load_string(sms_helper)
        screen.add_widget(self.sms)

        return screen
Esempio n. 7
0
 def __init__(self,**kwargs):
     super().__init__(**kwargs)
     self.btn1=MDRectangleFlatButton(text='Camera',pos_hint={'center_x': 0.5,'center_y' : 0.60})
     self.btn2=MDRectangleFlatButton(text='Gallery',pos_hint={'center_x': 0.5,'center_y' : 0.45})
     self.btn1.bind(on_press=button_to_camera)        
     self.add_widget(self.btn1)
     self.add_widget(self.btn2)
Esempio n. 8
0
    def potential_clients(self):
        # Checking if there are plot on result screen
        if self.graph is not None:
            self.root.ids.box.remove_widget(self.graph)

            # Reseting flag
            self.check_graph = False

        # Check if result screen already has clients list
        if self.check_clients == False:

            # Getting dataframe from .csv file
            df = pd.read_csv('csv.csv')

            # Formating data to object
            df['Дата'] = pd.to_datetime(df['Дата'])

            # Adding button, that leads to result screen
            btn = MDRectangleFlatButton(text='Go to result screen',
                                        pos_hint={'center_x': .5, 'center_y': .4})

            # Binding button with method
            btn.bind(on_press=self.switch)

            # Adding button
            self.root.ids.choice_screen.add_widget(btn)

            # Getting dataframe, with clients that made purchases in 2018 and 2019 years
            sr = df[df['Дата'].dt.year == 2018]
            sr1 = df[df['Дата'].dt.year == 2019]

            srr = sr[['Наименование']]
            srr1 = sr1[['Наименование']]

            ch = srr.values.tolist()
            ch1 = srr1.values.tolist()

            for name in ch:
                df.drop(df[df['Наименование'] == name[0]].index, inplace=True)

            for name in ch1:
                df.drop(df[df['Наименование'] == name[0]].index, inplace=True)

            abc = df['Наименование'].tolist()

            s = set(abc)

            text = 'Список потенциальных заказчиков:'

            for name in s:
                text += '\n\n' + name + ","

            # self.root.ids.result_text.text = text

            self.clients = MDLabel(text=text,
                                   halign='center')

            self.root.ids.result_screen.add_widget(self.clients)

            self.check_clients = True
Esempio n. 9
0
    def build(self):
        # screens
        screen1 = Screen(name="login")

        # l = GridLayout(cols=1)
        # label = MDLabel(text="fromage", halign='center', theme_text_color="Custom",
        #                 text_color=(0, 1, 0, 0.5), font_style='Caption',
        #                 pos_hint={'center_x': 0.5, 'center_y': 0.5})
        # icon_label = MDIcon(icon='language-python', halign='center',
        #                     pos_hint={'center_x': 0.5, 'center_y': 0.5})
        # l.add_widget(label)
        # l.add_widget(icon_label)
        # l.add_widget(MDFlatButton(text="fromage",
        # pos_hint={'center_x': 0.5, 'center_y': 0.5}))
        # l.add_widget(MDRectangleFlatButton(text='fromage',
        #                                   pos_hint={'center_x': 0.5, 'center_y': 0.5}))
        # username = MDTextField(text="enter id:", size_hint_x=None,
        #                        width=300, pos_hint={'center_x': 0.5, 'center_y': 0.5})

        button = MDRectangleFlatButton(text="show",
                                       pos_hint={
                                           'center_x': 0.5,
                                           'center_y': 0.4
                                       },
                                       on_release=self.show_data)
        self.username = Builder.load_string("""username_helper""")
        self.password = Builder.load_string("""password_helper""")

        screen1.add_widget(self.username)
        # screen1.add_widget(self.password)
        screen1.add_widget(button)

        self.sm.add_widget(screen1)

        # screen 2
        screen2 = Screen(name="list")
        scroll = ScrollView()
        list_view = MDList()

        items = [
            ThreeLineAvatarListItem(text="Item {}".format(i),
                                    secondary_text="Hello world",
                                    tertiary_text="text")
            for i in range(1, 21)
        ]
        for item in items:
            item.add_widget(ImageLeftWidget(source="fb.png"))
            list_view.add_widget(item)
        list_view.add_widget(
            MDRectangleFlatButton(text="show",
                                  pos_hint={
                                      'center_x': 0.5,
                                      'center_y': 0.4
                                  },
                                  on_release=self.change_dark))
        scroll.add_widget(list_view)
        screen2.add_widget(scroll)
        self.sm.add_widget(screen2)
        return self.sm
Esempio n. 10
0
    def build(self):
        self.theme_cls.theme_style = 'Dark'

        screen = Screen()
        md_button = MDRectangleFlatButton()
        md_button.text = 'Hello world'
        md_button.pos_hint = {'center_x': 0.5, 'center_y': 0.5}
        screen.add_widget(md_button)

        return screen
Esempio n. 11
0
    def show_data(self, obj):

        closeConfirm = MDRectangleFlatButton(text='Confirm',
                                             on_release=self.close_dialog)
        closeCancel = MDRectangleFlatButton(text='Cancel',
                                            on_release=self.close_dialog)
        self.dialog = MDDialog(title='Enter Quantity & Exp Date',
                               buttons=[closeConfirm, closeCancel],
                               size_hint=(0.7, 1))
        self.dialog.open()
Esempio n. 12
0
 def load_popup(self):
     self.directory_builder = Builder.load_string(directory_helper)
     cancel_button = MDRectangleFlatButton(text = "Cancel", on_release = self.close_load_popup)
     load_button = MDRectangleFlatButton(text = "Load", on_release = self.load)
     
     self.load_dialog = MDDialog(title = "Load file", 
                                 size_hint = (0.6, 1), type = "custom", 
                                 content_cls = self.directory_builder,
                                 buttons = [cancel_button, load_button])
     #self.screen.add_widget(self.save_helper)
     self.load_dialog.open()
Esempio n. 13
0
    def show_message(self, message):
        ok_btn = MDRectangleFlatButton(text="OK")
        ok_btn.bind(on_press=self.close)

        self.dialog = MDDialog (
        title="INFO",
        text=message,
        size_hint=(.8, 1),
        buttons=[ok_btn]
        )
        self.dialog.open()
Esempio n. 14
0
    def winners(self):
        # Checking if there are list of potential client on the result screent
        # and if there are, we are deleting this list from screen so that we can place plot on this screen
        if self.clients is not None:
            # Deleting list of potential clients
            self.root.ids.result_screen.remove_widget(self.clients)

            # Reseting flag
            self.check_clients = False

        # Checking if result screen already has a plot, and if not we are adding it
        if self.check_graph == False:

            # Dataframe that we get from .csv file
            df = pd.read_csv('csv.csv')

            # Counting winners from first column
            df1 = df['Победитель1'].value_counts()[df['Победитель1'].value_counts() >= 2]

            # Counting winners from second column
            df2 = df['Победитель2'].value_counts()[df['Победитель2'].value_counts() >= 2]

            # Adding dataframes into one dataframe
            frames = [df1, df2]
            df3 = pd.concat(frames)

            # Creating horizontal bar plot
            df3.plot.barh()

            plt.subplots_adjust(left=0.5)

            # Saving plot into image
            plt.savefig("image.png", bbox_inches='tight', dpi=150)

            # Creating image widget
            image = AsyncImage(source='image.png', )

            #Adding image to class variable
            self.graph = image

            self.root.ids.box.add_widget(image)

            # Adding button "Go to result"
            btn = MDRectangleFlatButton(text='Go to result screen',
                                        pos_hint={'center_x': .5, 'center_y': .4})

            # Binding button with method, which allows us go to result screen
            btn.bind(on_press=self.switch)

            # Adding button to screen
            self.root.ids.choice_screen.add_widget(btn)

            # Setting flag
            self.check_graph = True
Esempio n. 15
0
    def build(self):
        self.parent = BoxLayout(orientation='vertical')

        self.capture = cv.VideoCapture(0)
        self.my_camera = KivyCamera(capture=self.capture, fps=30)
        self.parent.add_widget(self.my_camera)

        self.shot_btn = MDRectangleFlatButton(text='Screen Shot')
        self.shot_btn.bind(on_release=self.screen_shot)
        self.shot_btn.increment_width = Window.size[0]
        self.parent.add_widget(self.shot_btn)
        return self.parent
Esempio n. 16
0
    def pause(self):
        # pause the game and all scheduled events
        self.in_play = False

        # create pause widgets (only the first time)
        if not self.pause_label:
            self.pause_label = Label(font_name='perpeta',
                                     font_size=40,
                                     text='GAME PAUSED',
                                     pos_hint={
                                         "center_x": 0.5,
                                         "center_y": 0.6
                                     })

        if not self.resume_label:
            self.resume_label = Label(font_name='perpeta',
                                      font_size=18,
                                      color=(0.8, 0.8, 0.8, 0.5),
                                      text='PRESS ENTER AGAIN TO RESUME',
                                      pos_hint={
                                          "center_x": 0.5,
                                          "center_y": 0.55
                                      })

        if not self.pause_button:
            self.pause_button = MDRectangleFlatButton(font_name='OpenSans',
                                                      font_size=20,
                                                      pos_hint={
                                                          "center_x": 0.5,
                                                          "center_y": 0.48
                                                      },
                                                      text_color=(1, 1, 1, 1),
                                                      text='BACK TO MENU')
            self.pause_button.md_bg_color = (0, 1, 0, 0.2)
            self.pause_button.bind(on_release=self.switch_screen)

        if not self.time_button:
            self.time_button = MDRectangleFlatButton(font_name='OpenSans',
                                                     font_size=20,
                                                     pos_hint={
                                                         "center_x": 0.5,
                                                         "center_y": 0.4
                                                     },
                                                     text_color=(1, 1, 1, 1),
                                                     text='TIME LEAP')
            self.time_button.md_bg_color = (0, 0, 1, 0.2)
            self.time_button.bind(on_release=self.time_dialog.open)

        # display pause widgets on the screen
        self.add_widget(self.pause_label)
        self.add_widget(self.resume_label)
        self.add_widget(self.pause_button)
        self.add_widget(self.time_button)
Esempio n. 17
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        camera_widget=Camera(play=True)
        #camera_widget.resolution=(720,1080)
        #camera_widget.orientation='vertical'
        camera_widget.resolution=(Window.size)
        camera_widget.pos_hint={'center_x':0.5,'center_y':0.5}
        button_widget=MDRectangleFlatButton(text='Search',pos_hint={'center_x': 0.5,'center_y' : 0.1})
        button_widget.bind(on_press=self.capture)
        self.add_widget(camera_widget)
        self.add_widget(button_widget)

        self.camera_reference=camera_widget    #referencing camera_widget(camera object) to camera_refernce
Esempio n. 18
0
    def show_data(self, obj):
        if self.username.text is "":
            check_string = "Please enter a username"
        else:
            check_string = self.username.text + 'does not exist'
        close_btn = MDRectangleFlatButton(text='Close',
                                          on_release=self.close_dlgbox)
        more_btn = MDRectangleFlatButton(text='More')

        self.showdialog = MDDialog(title='Username Check',
                                   text=check_string,
                                   size_hint=(0.5, 1),
                                   buttons=[close_btn, more_btn])
        self.showdialog.open()
Esempio n. 19
0
 def model(self, obj):
     try:
         pr = float(self.Pregnancies.text)
         gl = float(self.Glucose.text)
         bp = float(self.BloodPressure.text)
         st = float(self.SkinThickness.text)
         i = float(self.Insulin.text)
         bmi = float(self.BMI.text)
         dp = float(self.DiabetesPedigreeFunction.text)
         age = float(self.Age.text)
         m = MlModel(pr, gl, bp, st, i, bmi, dp, age)
         value = m.predict()
         if value == 0:
             check_string = 'You have no any sign of Diabetes'
         else:
             check_string = 'Consult to doctor you have sign of Diabetes'
     except Exception as e:
         check_string = str(
             e
         ) + ' ' + 'or try to provide numeric value and provide value for each component listed'
     close_button = MDRectangleFlatButton(text='Close',
                                          on_release=self.close_dialog)
     self.dialog = MDDialog(title='Result',
                            text=check_string,
                            size_hint=(.7, 1),
                            buttons=[close_button])
     self.dialog.open()
Esempio n. 20
0
    def build(self):
        self.theme_cls.primary_palette = "Green"
        sc = Screen()
        #username = MDTextField(text="enter user name",pos_hint={'center_x':0.5,'center_y':0.5},size_hint_x=None,width=300)
        #user input buider method
        self.username = Builder.load_string(username_helper)

        #theme is a property where evry element will have the color specified heere
        #self.theme_cls.primary_palette="Green"
        #self.theme_cls.theme_style="Dark"

        #buttons
        bt = MDRectangleFlatButton(text="Show",
                                   pos_hint={
                                       'center_x': 0.5,
                                       'center_y': 0.4
                                   },
                                   on_release=self.show_data)
        #label=MDLabel(text="first text",halign='center',theme_text_color='Custom',text_color=(0,1,0,1),font_style='H1')
        #coloring the label with theme_text_color='colorname'
        #or with custom color theme_text_color='Custom'
        #lab=MDIcon(icon='language-python')
        sc.add_widget(self.username)
        sc.add_widget(bt)
        return sc
    def download_audio_playlist(self, obj):
        url = self.url.text
        self.pl = Playlist(url)
        self.downloading_message.dismiss()

        self.downloading_message = MDDialog(
            title="Downloading...", text=f"Downloading.. {self.pl.title}")
        self.downloading_message.open()

        for songs in self.pl.videos:
            songs.streams.get_audio_only(subtype="mp4").download(
                r"c:\video_downloader/audios/playlists/" + self.pl.title)

        self.downloading_message.dismiss()

        download_location = r"c:\video_downloader/audios/playlists/" + self.pl.title
        close_btn = MDRectangleFlatButton(text="close",
                                          on_press=self.close_dialog)

        self.downloading_message = MDDialog(
            title="Download completed",
            text=
            f"successfully downloaded {self.pl.title} at {download_location}",
            buttons=[close_btn])
        self.downloading_message.open()
    def download_video_playlist(self, obj):
        url = self.url.text
        self.pl = Playlist(url)
        self.downloading_message.dismiss()

        self.downloading_message = MDDialog(
            title="Downloading...", text=f"Downloading.. {self.pl.title}")
        self.downloading_message.open()

        for vids in self.pl.videos:
            vids.streams.filter(
                progressive=True).get_highest_resolution().download(
                    r"c:\video_downloader/videos/playlists/" + self.pl.title)

        self.downloading_message.dismiss()

        download_location = r"c:\video_downloader/videos/playlists/" + self.pl.title
        close_btn = MDRectangleFlatButton(text="close",
                                          on_press=self.close_dialog)

        self.downloading_message = MDDialog(
            title="Download completed",
            text=
            f"successfully downloaded {self.pl.title} at {download_location}",
            buttons=[close_btn])
        self.downloading_message.open()
Esempio n. 23
0
    def build(self):
        screen = Screen()

        btn_flat = MDFlatButton(text='Hello World',
                                pos_hint={
                                    'center_x': .5,
                                    'center_y': .9
                                })

        btn_rectangle_flat = MDRectangleFlatButton(text='Hello World',
                                                   pos_hint={
                                                       'center_x': .5,
                                                       'center_y': .8
                                                   })

        icon_btn = MDIconButton(icon='android',
                                pos_hint={
                                    'center_x': .5,
                                    'center_y': .7
                                })

        icon_floating_btn = MDFloatingActionButton(icon='language-python',
                                                   pos_hint={
                                                       'center_x': .5,
                                                       'center_y': .6
                                                   })

        screen.add_widget(btn_flat)
        screen.add_widget(btn_rectangle_flat)
        screen.add_widget(icon_btn)
        screen.add_widget(icon_floating_btn)

        return screen
Esempio n. 24
0
 def add_pantry_item(self,instance):
     self.bufferDate = None #reset bufferdate back to null when dialog box opens
     self.food_name = instance.text #this gets the title of the item clicked
     self.test = instance
     print(self.test)
     #So looks like variables need to use self. to be able to use elsewhere
     close_button = MDRectangleFlatButton(text = 'Close', on_release=self.close_dialog)
     submit_button = MDRectangleFlatButton(text = 'Submit', on_release =self.submit_dialog)
     self.dialog = MDDialog(
         title = "Add item to Pantry?",
         size_hint=(0.8,1),
         type="custom",
         content_cls = dialog_content(),
         buttons=[submit_button,close_button]
     )
     self.dialog.open()
Esempio n. 25
0
 def on_start(self):
     self.root.ids.coc.add_widget(
         MDRectangleFlatButton(
             text=str('Привет'),
             size_hint=(.1, None),
             # on_press=root.manager.current = 'menu',
         ))
     self.cursor.execute(self.sql['getChat_name'])
     chat_name = self.cursor.fetchall()
     for i in range(0, len(chat_name)):
         self.root.ids.box.add_widget(
             MDRectangleFlatButton(
                 text=str(*chat_name[i]),
                 size_hint=(.1, None),
                 on_press=lambda x: self.message(i),
             ))
Esempio n. 26
0
    def get_data(self):
        ages = [
            '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18',
            '19', '20', '21', '22', '23', '24', '25', '26', '27', '28'
        ]
        name = self.user.text
        age_field = self.age_field.text
        email_field = self.email_field.text
        pass_field = self.pass_field.text
        text = ""

        if name == "" or len(name) < 5 or age_field not in ages or check(
                email_field) == False or len(pass_field) < 8:

            text = "Invalid Invalid"
            title = "Account Not Created"
            self.screen = 'no'

        else:
            text = f"Account Created With Username : {name}"
            title = "Account Created Sucessfully"
            self.screen = 'change'

        close_btn = MDRectangleFlatButton(
            text="Ok",
            on_release=lambda x: self.close_dialog(name, email_field))

        self.dailog = MDDialog(title=title,
                               text=text,
                               size_hint_x=0.9,
                               buttons=[close_btn])

        self.dailog.open()
Esempio n. 27
0
    def build(self):
        screen = Screen()
        btn1 = MDRectangleFlatButton(text='Select Client No', pos_hint={'center_x': 0.5, 'center_y': 0.5},on_release=self.select_client_no)

        

        btn3 = MDRectangleFlatButton(text='Import', pos_hint={'center_x': 0.2, 'center_y': 0.5},on_release=self.func_imp)

        

        btn2 = MDRectangleFlatButton(text='Start', pos_hint={'center_x': 0.8, 'center_y': 0.5},on_release=self.run_prog)

        screen.add_widget(btn3)                            
        screen.add_widget(btn2)
        screen.add_widget(btn1)
        return screen
Esempio n. 28
0
    def build(self):
        self.theme_cls.primary_palette = "Green"
        self.theme_cls.primary_hue = "700"
        self.theme_cls.theme_style = 'Dark'
        screen = Screen()
        # button_flat = MDRectangleFlatButton(text='Hello World',
        # pos_hint={"center_x": 0.5, "center_y": 0.5})
        # icon_btn = MDIconButton(icon = 'android',
        #         pos_hint={"center_x": 0.5, "center_y": 0.5})
        # icon_btn = MDFloatingActionButton(icon = 'android',
        #         pos_hint={"center_x": 0.5, "center_y": 0.5})
        btn_login = MDRectangleFlatButton(text='Login',
                                          pos_hint={
                                              "center_x": 0.5,
                                              "center_y": 0.4
                                          },
                                          on_release=self.show_data)

        # username = MDTextField(text = "Enter username",
        #         pos_hint={"center_x": 0.5, "center_y": 0.5},
        #         size_hint_x=None,width=300)

        self.username = Builder.load_string(username_helper)
        screen.add_widget(self.username)
        screen.add_widget(btn_login)
        return screen
    def build(self):
        self.theme_cls.primary_palette = "Orange"
        self.theme_cls.theme_style = "Dark"
        screen = Screen()

        title = MDLabel(text="Health Check", halign="center", theme_text_color="Custom", font_style="H3",
                        pos_hint={'center_x': 0.5, 'center_y': 0.85}, text_color=(255 / 256, 165 / 256, 0 / 256, 1))

        submit_button = MDRectangleFlatButton(text="Submit", pos_hint={'center_x': 0.5, 'center_y': 0.1},
                                              on_release=self.show_data)

        self.input_one = Builder.load_string(input_one_helper)
        self.input_two = Builder.load_string(input_two_helper)
        self.input_three = Builder.load_string(input_three_helper)

        self.doctor_email = Builder.load_string(doctor_email_helper)

        screen.add_widget(title)
        screen.add_widget(submit_button)

        screen.add_widget(self.input_one)
        screen.add_widget(self.input_two)
        screen.add_widget(self.input_three)

        screen.add_widget(self.doctor_email)

        return screen
Esempio n. 30
0
    def build(self):
        self.theme_cls.primary_palette = "Blue"
        screen = Screen()

        text = MDToolbar(title='Health Monitor App',
                         specific_text_color=(1, 1, 1, 1),
                         pos_hint={
                             'center_x': 0.5,
                             'center_y': 0.95
                         })

        img = Image(source="Healt.jpg",
                    pos_hint={
                        'center_x': 0.5,
                        'center_y': 0.5
                    })

        button = MDRectangleFlatButton(text='Continue',
                                       pos_hint={
                                           'center_x': 0.5,
                                           'center_y': 0.2
                                       },
                                       on_release=self.login)
        screen.add_widget(text)
        screen.add_widget(img)
        screen.add_widget(button)
        return screen