Check-A-Prijs-Mobile-App_Hack-O-Topia_PTC / PriceCharm / screen_1.kv
screen_1.kv
Raw
#: import utils kivy.utils

<Screen1>       
    id: firstscreen
    name: "Screen_1"
    BoxLayout:
        id: 'scrbox'
        orientation: "vertical"
        spacing: 10
        padding: 20
        pos_hint: {'center_x': 0.5}
        GridLayout:
            # size_hint_y: None
            # height: self.minimum_height
            id : 'topMostGrid'
            cols: 4
            rows:1
            Button: 
                id: 'HomeScreen'
                text: "Price_Checker"
                size_hint: (None,None)
                width: 210
                height: "40dp"
            Label:
                text: ''
                size_hint_x: None
                width: 25
            Button: 
                text: "S"
                size_hint: (None,None)
                width: 40
                height: "40dp"
            Button: 
                text: "M"
                size_hint: (None,None)
                width: 40
                height: "40dp"
                color: utils.get_color_from_hex("#AE1658")

        GridLayout:
            cols: 3
            rows: 1
            pos_hint:{'center_x': 0.5}
            Button:
                id: 'screen1Home'
                text: "Home"
                size_hint: (None,None)
                width: 105
                height: "40dp"
                on_press: app.root.switch_screen_to_Screen_1()
                on_release: app.root.current = "Screen_1"
            Button:
                id: 'screen1HotItems'
                text: "Hot Items"
                size_hint: (None,None)
                width: 105
                height: "40dp"
                on_press: app.root.switch_screen_to_Screen_2()
                on_release: app.root.current = "Screen_2" 
            Button:
                id: 'screen1Gallery'
                text: "Gallery"
                size_hint: (None,None)
                width: 105
                height: "40dp"
                on_press: app.root.switch_screen_to_Screen_3()
                on_release: app.root.current = "Screen_3"  
        GridLayout:
            size_hint_y: None
            height: 60
            rows: 2
            cols: 1
            Label:
                id: 'ShopLabel'
                text: "Shop"
            TextInput:
                id: 'NameShopInput'
                pos: (10,10)
                size_hint: (None, None)
                width: 315
                height: '40dp'
                multiline: True
                on_text: root.fill_Shop_input(self, self.text)
    
        GridLayout:
            size_hint_y: None
            height: 60
            rows: 2
            cols: 1
            Label:
                text: "Product"
            TextInput:
                id: 'ProductInput'
                pos: (10,10)
                size_hint: (None, None)
                width: 315
                height: '40dp'
                multiline: True
                on_text: root.fill_Product_input(self, self.text)

        BoxLayout:
            size_hint_y: None
            height: self.minimum_height
            orientation: 'vertical'
            spacing:20
            Image:
                id: 'ProductImage'
                pos_hint:{'center_x': 0.5}
                source: r'D:\Studies\Coding\Python Programming\VsCode\Kivy\AppDev\PriceCharm\Images\Markant Bruine Bonen 840g Blik.jpg'
                allow_stretch: True
                keep_ratio: False
                size_hint: (None,None)
                width: 150
                height: 120
                # size_hint:

            Label: 
                text: 'OR'
            Button:
                id: 'addPicture'
                pos_hint:{'center_x': 0.5}
                text: "Add a Picture"
                size_hint: (None,None)
                width: 105
                height: "40dp"


            Label: 
                text: 'Price'
            TextInput:
                id: ''
                pos_hint:{'center_x': 0.5}
                size_hint: (None, None)
                width: 115
                height: '40dp'
                multiline: True
            Button:
                id: "SubmitButton"
                pos_hint:{'center_x': 0.5}
                text: "Submit"
                size_hint: (None,None)
                width: 105
                height: "40dp"
                on_press: app.root.submit_btn()