├── loggin demo ├── saved_creds.db ├── resources │ ├── fonts │ │ ├── 1.ttf │ │ ├── 2b.ttf │ │ ├── digi.ttf │ │ ├── Lexend-Bold.ttf │ │ ├── Lexend-Light.ttf │ │ ├── Lexend-Thin.ttf │ │ └── Lexend-ExtraLight.ttf │ └── images │ │ ├── dis.png │ │ ├── en.png │ │ ├── mail.png │ │ ├── pass.png │ │ └── loading.png ├── supperwidget │ ├── __pycache__ │ │ ├── supperlabel.cpython-310.pyc │ │ ├── supperbutton.cpython-310.pyc │ │ └── suppertextinput.cpython-310.pyc │ ├── supperbutton.py │ ├── supperlabel.kv │ ├── supperbutton.kv │ ├── supperlabel.py │ ├── suppertextinput.kv │ └── suppertextinput.py ├── README.md ├── the.kv └── main.py ├── README.md ├── git_kivy_clock ├── clock.png ├── the.kv └── main.py ├── git_kivy_dropdown ├── 1.ttf ├── the.kv └── main.py ├── git_kivy_btnimage ├── img.png ├── the.kv └── main.py ├── git.kivy_chatapp ├── part_1 │ ├── 1.ttf │ ├── send.png │ ├── screenshot.png │ ├── screenshot2.png │ ├── the.kv │ └── main.py ├── part_2 │ ├── 1.ttf │ ├── send.png │ ├── main.py │ └── the.kv ├── part_3 │ ├── 1.ttf │ ├── send.png │ ├── the.kv │ └── main.py ├── part_4 │ ├── 1.ttf │ ├── send.png │ ├── the.kv │ └── main.py └── part_5 │ ├── 1.ttf │ ├── send.png │ ├── the.kv │ └── main.py ├── git_kivy_illusion ├── screen.png └── main.py ├── git_kivy_notification ├── python.png ├── the.kv └── main.py ├── git_mapview ├── fifth_part │ ├── dist.png │ ├── me_32.png │ ├── avatar.png │ ├── the.kv │ └── main.py ├── first_part │ ├── me_32.png │ ├── the.kv │ └── main.py ├── sixth_part │ ├── dist.png │ ├── me_32.png │ ├── avatar.png │ ├── waypoints.png │ ├── the.kv │ └── main.py ├── thrid_part │ ├── dist.png │ ├── me_32.png │ ├── avatar.png │ ├── the.kv │ └── main.py ├── second_part │ ├── avatar.png │ ├── me_32.png │ ├── the.kv │ └── main.py └── fourth_part │ └── sort_gpx.py ├── git.kivy_date ├── resources │ ├── fonts │ │ └── 1.ttf │ └── images │ │ ├── lt.png │ │ ├── rt.png │ │ └── accept.png ├── supperwidget │ ├── supperbutton.py │ └── supperbutton.kv ├── the.kv ├── main.py └── buildozer.spec ├── git_kivy_scrollview ├── scrollthumb.png ├── the.kv └── main.py ├── git_kivy_threads ├── the.kv └── main.py ├── git_kivy_properties ├── the.kv └── main.py ├── git_kivy_filechooser ├── the.kv └── main.py ├── git_kivy_changebyid ├── the.kv └── main.py ├── git_kivy_list_of_widgets ├── the.kv └── main.py ├── git_kivy_screen_manager ├── the.kv └── main.py └── git.kivy_class_variable ├── the.kv └── main.py /loggin demo/saved_creds.db: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #kivy-tuto 2 | this is a repo for some kivy example codes 3 | -------------------------------------------------------------------------------- /git_kivy_clock/clock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_clock/clock.png -------------------------------------------------------------------------------- /git_kivy_dropdown/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_dropdown/1.ttf -------------------------------------------------------------------------------- /git_kivy_btnimage/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_btnimage/img.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_1/1.ttf -------------------------------------------------------------------------------- /git.kivy_chatapp/part_2/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_2/1.ttf -------------------------------------------------------------------------------- /git.kivy_chatapp/part_3/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_3/1.ttf -------------------------------------------------------------------------------- /git.kivy_chatapp/part_4/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_4/1.ttf -------------------------------------------------------------------------------- /git.kivy_chatapp/part_5/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_5/1.ttf -------------------------------------------------------------------------------- /git_kivy_illusion/screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_illusion/screen.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_1/send.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_2/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_2/send.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_3/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_3/send.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_4/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_4/send.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_5/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_5/send.png -------------------------------------------------------------------------------- /git_kivy_notification/python.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_notification/python.png -------------------------------------------------------------------------------- /git_mapview/fifth_part/dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/fifth_part/dist.png -------------------------------------------------------------------------------- /git_mapview/fifth_part/me_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/fifth_part/me_32.png -------------------------------------------------------------------------------- /git_mapview/first_part/me_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/first_part/me_32.png -------------------------------------------------------------------------------- /git_mapview/sixth_part/dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/sixth_part/dist.png -------------------------------------------------------------------------------- /git_mapview/sixth_part/me_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/sixth_part/me_32.png -------------------------------------------------------------------------------- /git_mapview/thrid_part/dist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/thrid_part/dist.png -------------------------------------------------------------------------------- /git_mapview/thrid_part/me_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/thrid_part/me_32.png -------------------------------------------------------------------------------- /git_mapview/fifth_part/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/fifth_part/avatar.png -------------------------------------------------------------------------------- /git_mapview/first_part/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | MapView: 4 | id: main_map 5 | size: root.width, root.height 6 | 7 | 8 | -------------------------------------------------------------------------------- /git_mapview/second_part/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/second_part/avatar.png -------------------------------------------------------------------------------- /git_mapview/second_part/me_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/second_part/me_32.png -------------------------------------------------------------------------------- /git_mapview/sixth_part/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/sixth_part/avatar.png -------------------------------------------------------------------------------- /git_mapview/thrid_part/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/thrid_part/avatar.png -------------------------------------------------------------------------------- /loggin demo/resources/fonts/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/1.ttf -------------------------------------------------------------------------------- /loggin demo/resources/fonts/2b.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/2b.ttf -------------------------------------------------------------------------------- /git.kivy_date/resources/fonts/1.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_date/resources/fonts/1.ttf -------------------------------------------------------------------------------- /git.kivy_date/resources/images/lt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_date/resources/images/lt.png -------------------------------------------------------------------------------- /git.kivy_date/resources/images/rt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_date/resources/images/rt.png -------------------------------------------------------------------------------- /git_kivy_scrollview/scrollthumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_kivy_scrollview/scrollthumb.png -------------------------------------------------------------------------------- /git_mapview/sixth_part/waypoints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git_mapview/sixth_part/waypoints.png -------------------------------------------------------------------------------- /loggin demo/resources/fonts/digi.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/digi.ttf -------------------------------------------------------------------------------- /loggin demo/resources/images/dis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/images/dis.png -------------------------------------------------------------------------------- /loggin demo/resources/images/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/images/en.png -------------------------------------------------------------------------------- /loggin demo/resources/images/mail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/images/mail.png -------------------------------------------------------------------------------- /loggin demo/resources/images/pass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/images/pass.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_1/screenshot.png -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_chatapp/part_1/screenshot2.png -------------------------------------------------------------------------------- /git.kivy_date/resources/images/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/git.kivy_date/resources/images/accept.png -------------------------------------------------------------------------------- /loggin demo/resources/images/loading.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/images/loading.png -------------------------------------------------------------------------------- /loggin demo/resources/fonts/Lexend-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/Lexend-Bold.ttf -------------------------------------------------------------------------------- /loggin demo/resources/fonts/Lexend-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/Lexend-Light.ttf -------------------------------------------------------------------------------- /loggin demo/resources/fonts/Lexend-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/Lexend-Thin.ttf -------------------------------------------------------------------------------- /loggin demo/resources/fonts/Lexend-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/resources/fonts/Lexend-ExtraLight.ttf -------------------------------------------------------------------------------- /git_kivy_threads/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | Label: 4 | id: lbl 5 | text: 'tuto threading' 6 | font_size: root.height*0.05 7 | pos: root.width*0.3, root.height*0.5 -------------------------------------------------------------------------------- /loggin demo/supperwidget/__pycache__/supperlabel.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/supperwidget/__pycache__/supperlabel.cpython-310.pyc -------------------------------------------------------------------------------- /loggin demo/supperwidget/__pycache__/supperbutton.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/supperwidget/__pycache__/supperbutton.cpython-310.pyc -------------------------------------------------------------------------------- /loggin demo/supperwidget/__pycache__/suppertextinput.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TirrouOussama/kivy_tuto/HEAD/loggin demo/supperwidget/__pycache__/suppertextinput.cpython-310.pyc -------------------------------------------------------------------------------- /git_kivy_properties/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | Label: 4 | text: root.string_example 5 | font_size: root.numeric_example 6 | color: root.list_example 7 | 8 | size: root.width*0.2, root.height*0.05 9 | pos: root.width*0.4 ,root.height*0.5 10 | -------------------------------------------------------------------------------- /git_kivy_filechooser/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | Image: 4 | id: bck 5 | source: '' 6 | size: root.size 7 | 8 | 9 | Button: 10 | text: 'choose file' 11 | size: root.width*0.2, root.height*0.05 12 | pos: root.width*0.4, root.height*0.1 13 | on_press: root.select_file() -------------------------------------------------------------------------------- /git_kivy_changebyid/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | Label: 4 | id: lb 5 | pos: 0, 0 6 | font_size: root.height*0.023 7 | 8 | 9 | 10 | Button: 11 | text: 'change by id' 12 | size: root.width*0.4, root.height*0.05 13 | pos: root.width*0.3, root.height*0.2 14 | on_press: root.change() 15 | -------------------------------------------------------------------------------- /git_kivy_btnimage/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | Button: 4 | background_color: 0, 0, 0, 0 5 | text: 'btn' 6 | size: root.width*0.1, root.height*0.1 7 | pos:root.width*0.45, root.height*0.45 8 | on_press: root.press() 9 | Image: 10 | source: 'img.png' #64*64 pxls 11 | pos: self.parent.pos 12 | size: self.parent.size 13 | allow_stretch: True -------------------------------------------------------------------------------- /git_kivy_list_of_widgets/the.kv: -------------------------------------------------------------------------------- 1 | 2 | Button: 3 | text: 'create' 4 | size: root.width*0.4, root.height*0.05 5 | pos: root.width*0.3, root.height*0.1 6 | on_press: root.create() 7 | 8 | 9 | 10 | Button: 11 | text: 'delete' 12 | size: root.width*0.4, root.height*0.05 13 | pos: root.width*0.3, root.height*0.2 14 | on_press: root.delete() -------------------------------------------------------------------------------- /git_mapview/second_part/the.kv: -------------------------------------------------------------------------------- 1 | 2 | MapView: 3 | id: main_map 4 | size: root.width, root.height 5 | 6 | MapMarkerPopup: 7 | id: main_map_me 8 | lat: 36.5924 9 | lon: 2.9898 10 | source: 'me_32.png' 11 | Button: 12 | size: root.width*0.8, root.height*0.8 13 | background_color: 0, 0, 0, 0 14 | background_normal: '' 15 | on_press: root.press() 16 | canvas.before: 17 | Ellipse: 18 | source: root.my_avat 19 | angle_start: 0 20 | angle_end: 360 -------------------------------------------------------------------------------- /git_kivy_clock/the.kv: -------------------------------------------------------------------------------- 1 | 2 | Label: 3 | id: lb 4 | color: 1, 1, 1, 1 5 | 6 | font_size: root.height*0.023 7 | size: root.width*0.2, root.height*0.1 8 | pos: root.width*0.4, root.height*0.45 9 | 10 | 11 | Button: 12 | text: 'stop' 13 | size: root.width*0.2, root.height*0.05 14 | pos: root.width*0.4, root.height*0.3 15 | on_press: root.stop() 16 | 17 | 18 | Button: 19 | text: 'start' 20 | size: root.width*0.2, root.height*0.05 21 | pos: root.width*0.4, root.height*0.6 22 | on_press: root.start() -------------------------------------------------------------------------------- /git_kivy_dropdown/the.kv: -------------------------------------------------------------------------------- 1 | #:import Factory kivy.factory.Factory 2 | 3 | : 4 | color: 1,0,0,1 5 | font_name: '1.ttf' 6 | background_color: 0.4, 0.4, 0, 1 7 | 8 | 9 | canvas.before: 10 | Color: 11 | rgba: 1, 1, 1, 1 12 | Rectangle: 13 | size: root.width, root.height 14 | 15 | Spinner: 16 | id: drop 17 | size: root.width*0.4, root.height*0.05 18 | pos: root.width*0.3, root.height*0.5 19 | font_name: '1.ttf' 20 | text: 'DropDown' 21 | values: ['item 1', 'item 2', 'item 3', 'item 4'] 22 | sync_height: True 23 | on_text: root.select() 24 | option_cls: Factory.sp 25 | -------------------------------------------------------------------------------- /git_kivy_notification/the.kv: -------------------------------------------------------------------------------- 1 | 2 | canvas.before: 3 | Color: 4 | rgba: 1, 1, 1, 1 5 | 6 | Rectangle: 7 | size: root.size 8 | 9 | 10 | Label: 11 | text: 'notification test' 12 | size: root.width*0.3, root.height*0.1 13 | pos: root.width*0.35, root.height*0.45 14 | font_size: root.width*0.05 15 | color: 0, 0, 0, 1 16 | 17 | 18 | Button: 19 | text: 'notify' 20 | size: root.width*0.2, root.height*0.05 21 | pos: root.width*0.4, root.height*0.1 22 | on_press: root.notifyme() 23 | 24 | TextInput: 25 | id: inp 26 | size: root.width*0.4, root.height*0.05 27 | pos: root.width*0.3, root.height*0.2 28 | hint_text: 'Enter notif text' 29 | color: 0,0,0,1 30 | halign: 'center' -------------------------------------------------------------------------------- /git_kivy_screen_manager/the.kv: -------------------------------------------------------------------------------- 1 | 2 | Label: 3 | text: 'this is the first screen' 4 | font_size: root.height*0.05 5 | size: root.width*0.4, root.height*0.5 6 | pos: root.width*0.3, root.height*0.5 7 | 8 | Button: 9 | text: 'switch screen' 10 | size: root.width*0.2, root.height*0.05 11 | pos: root.width*0.4, root.height*0.2 12 | on_press: root.change() 13 | 14 | 15 | 16 | Label: 17 | text: 'this is the second screen' 18 | font_size: root.height*0.05 19 | size: root.width*0.4, root.height*0.5 20 | pos: root.width*0.3, root.height*0.5 21 | 22 | Button: 23 | text: 'switch screen' 24 | size: root.width*0.2, root.height*0.05 25 | pos: root.width*0.4, root.height*0.2 26 | on_press: root.change() 27 | -------------------------------------------------------------------------------- /git_mapview/thrid_part/the.kv: -------------------------------------------------------------------------------- 1 | 2 | MapView: 3 | id: main_map 4 | size: root.width, root.height 5 | 6 | MapMarkerPopup: 7 | id: main_map_me 8 | lat: 36.5924 9 | lon: 2.9898 10 | source: 'me_32.png' 11 | Button: 12 | size: root.width*0.8, root.height*0.8 13 | background_color: 0, 0, 0, 0 14 | background_normal: '' 15 | on_press: root.press() 16 | canvas.before: 17 | Ellipse: 18 | source: root.my_avat 19 | angle_start: 0 20 | angle_end: 360 21 | 22 | 23 | Button: 24 | text: 'place pin' 25 | size: root.width*0.3, root.height*0.05 26 | pos: 0, 0 27 | on_press: root.place_pin() 28 | 29 | Button: 30 | text: 'remove pin' 31 | size: root.width*0.3, root.height*0.05 32 | pos: root.width*0.7, 0 33 | on_press: root.remove_pin() -------------------------------------------------------------------------------- /git_mapview/fifth_part/the.kv: -------------------------------------------------------------------------------- 1 | 2 | MapView: 3 | id: main_map 4 | size: root.width, root.height 5 | 6 | MapMarkerPopup: 7 | id: main_map_me 8 | lat: 36.5924 9 | lon: 2.9898 10 | source: 'me_32.png' 11 | Button: 12 | size: root.width*0.8, root.height*0.8 13 | background_color: 0, 0, 0, 0 14 | background_normal: '' 15 | on_press: root.press() 16 | canvas.before: 17 | Ellipse: 18 | source: root.my_avat 19 | angle_start: 0 20 | angle_end: 360 21 | 22 | 23 | Button: 24 | text: 'place pin' 25 | size: root.width*0.3, root.height*0.05 26 | pos: 0, 0 27 | on_press: root.place_pin() 28 | 29 | 30 | Button: 31 | text: 'remove pin' 32 | size: root.width*0.3, root.height*0.05 33 | pos: root.width*0.7, 0 34 | on_press: root.remove_pin() 35 | -------------------------------------------------------------------------------- /git_mapview/sixth_part/the.kv: -------------------------------------------------------------------------------- 1 | 2 | MapView: 3 | id: main_map 4 | size: root.width, root.height 5 | 6 | MapMarkerPopup: 7 | id: main_map_me 8 | lat: 36.5924 9 | lon: 2.9898 10 | source: 'me_32.png' 11 | Button: 12 | size: root.width*0.8, root.height*0.8 13 | background_color: 0, 0, 0, 0 14 | background_normal: '' 15 | on_press: root.press() 16 | canvas.before: 17 | Ellipse: 18 | source: root.my_avat 19 | angle_start: 0 20 | angle_end: 360 21 | 22 | 23 | Button: 24 | text: 'place pin' 25 | size: root.width*0.3, root.height*0.05 26 | pos: 0, 0 27 | on_press: root.place_pin() 28 | 29 | 30 | Button: 31 | text: 'remove pin' 32 | size: root.width*0.3, root.height*0.05 33 | pos: root.width*0.7, 0 34 | on_press: root.remove_pin() 35 | -------------------------------------------------------------------------------- /git_kivy_scrollview/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.width, root.height 9 | pos: 0, 0 10 | 11 | 12 | 13 | ScrollView: 14 | size: root.width*0.4, root.height*0.4 15 | pos: root.height*0.3, root.height*0.3 16 | Label: 17 | id: output 18 | color: 0, 0, 0, 1 19 | text: '' 20 | size_hint_x: 1.0 21 | size_hint_y: None 22 | text_size: self.width, None 23 | height: self.texture_size[1] 24 | 25 | 26 | 27 | 28 | 29 | 30 | TextInput: 31 | id: input 32 | size: root.width*0.6, root.height*0.05 33 | pos: root.width*0.2, root.height*0.2 34 | hint_text: 'Push me To scroll' 35 | 36 | 37 | Button: 38 | text: ' push me' 39 | size: root.width*0.4, root.height*0.05 40 | pos: root.width*0.3, root.height*0.1 41 | on_press: root.push_me() -------------------------------------------------------------------------------- /git_kivy_dropdown/main.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.label import Label 3 | from kivy.uix.button import Button 4 | from kivy.uix.widget import Widget 5 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 6 | from kivy.core.window import Window 7 | from kivy.uix.dropdown import DropDown 8 | 9 | 10 | class fscreen(Widget): 11 | def __init__(self, **kwargs): 12 | super().__init__(**kwargs) 13 | 14 | 15 | def select(self): 16 | print(self.ids.drop.text) 17 | 18 | 19 | class theapp(App): 20 | def build(self): 21 | self.screenm = ScreenManager() 22 | 23 | self.fscreen = fscreen() 24 | screen = Screen(name = "fscreen") 25 | screen.add_widget(self.fscreen) 26 | self.screenm.add_widget(screen) 27 | 28 | 29 | return self.screenm 30 | 31 | if __name__ == "__main__": 32 | theapp = theapp() 33 | theapp.run() -------------------------------------------------------------------------------- /loggin demo/supperwidget/supperbutton.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.button import Button 2 | from kivy.clock import Clock 3 | from kivy.properties import NumericProperty, StringProperty, ListProperty 4 | from kivy.utils import get_color_from_hex 5 | from kivy_gradient import Gradient 6 | 7 | 8 | class SupperButton(Button): 9 | gr_left = StringProperty() 10 | gr_middle = StringProperty() 11 | gr_right = StringProperty() 12 | border_width = NumericProperty(1) 13 | border_color = ListProperty([0, 0, 0, 1]) 14 | 15 | def __init__(self, **kwargs): 16 | super().__init__(**kwargs) 17 | self.l_save = None 18 | self.r_save = None 19 | 20 | def pressed(self): 21 | self.l_save = self.gr_left 22 | self.r_save = self.gr_right 23 | self.gr_left = "#474747" 24 | self.gr_right = "#949191" 25 | Clock.schedule_interval(self.press_anim, 0.3) 26 | 27 | def press_anim(self, *args): 28 | self.gr_left = self.l_save 29 | self.gr_right = self.r_save 30 | Clock.unschedule(self.press_anim) 31 | -------------------------------------------------------------------------------- /git.kivy_date/supperwidget/supperbutton.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.button import Button 2 | from kivy.clock import Clock 3 | from kivy.properties import NumericProperty, StringProperty, ListProperty 4 | from kivy.utils import get_color_from_hex 5 | from kivy_gradient import Gradient 6 | 7 | 8 | class SupperButton(Button): 9 | gr_left = StringProperty() 10 | gr_middle = StringProperty() 11 | gr_right = StringProperty() 12 | border_width = NumericProperty(1) 13 | border_color = ListProperty([0, 0, 0, 1]) 14 | 15 | def __init__(self, **kwargs): 16 | super().__init__(**kwargs) 17 | self.l_save = None 18 | self.r_save = None 19 | 20 | def pressed(self): 21 | self.l_save = self.gr_left 22 | self.r_save = self.gr_right 23 | self.gr_left = "#474747" 24 | self.gr_right = "#949191" 25 | Clock.schedule_interval(self.press_anim, 0.3) 26 | 27 | def press_anim(self, *args): 28 | self.gr_left = self.l_save 29 | self.gr_right = self.r_save 30 | Clock.unschedule(self.press_anim) 31 | -------------------------------------------------------------------------------- /git_mapview/fourth_part/sort_gpx.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | import requests 4 | import re 5 | 6 | 7 | start_lon = 3.006193661499026 8 | start_lat = 36.59308912856339 9 | 10 | end_lon = 2.999173625182806 11 | end_lat = 36.61426132068456 12 | 13 | 14 | body = {"coordinates":[[start_lon,start_lat],[end_lon,end_lat]]} 15 | 16 | headers = { 17 | 'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8', 18 | 'Authorization': '5b3ce3597851110001cf6248e32f3f787ba541e8b3d916f4681b9340', 19 | 'Content-Type': 'application/json; charset=utf-8' 20 | } 21 | call = requests.post('https://api.openrouteservice.org/v2/directions/driving-car/gpx', json=body, headers=headers) 22 | 23 | 24 | string_res = call.text 25 | 26 | print(string_res) 27 | 28 | tag = 'rtept' 29 | reg_str = '(.*?)' + '>' 30 | res = re.findall(reg_str, string_res) 31 | print(res) 32 | print('_____________________________________') 33 | string1 = str(res) 34 | tag1 = '"' 35 | reg_str1 = '"' + '(.*?)' + '"' 36 | res1 = re.findall(reg_str1, string1) 37 | print(res1) 38 | -------------------------------------------------------------------------------- /loggin demo/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 📱 Features 4 | Responsive Login UI with loading animations. 5 | 6 | Saved Credentials System using SQLite. 7 | 8 | Email & Password Format Validation (regex). 9 | 10 | Threaded Login Logic with timeouts. 11 | 12 | MAC Address Retrieval (for device identification). 13 | 14 | Three Screens: Initial loading, login screen, and main screen. 15 | 16 | Modular design using custom widgets: 17 | 18 | SupperTextinput 19 | 20 | SupperButton 21 | 22 | SupperLabel 23 | 24 | 25 | 📂 Project Structure 26 | 27 | . 28 | ├── main.py # Main app logic (this file) 29 | ├── saved_creds.db # SQLite database (created at runtime) 30 | └── supperwidget/ # Folder for reusable widgets 31 | ├── suppertextinput.kv 32 | ├── suppertextinput.py 33 | ├── supperbutton.kv 34 | ├── supperbutton.py 35 | ├── supperlabel.kv 36 | └── supperlabel.py 37 | 38 | 📷 Screenshots 39 | ![s](https://github.com/user-attachments/assets/6a737f36-83f2-42ca-bf06-d3d586cf7332) 40 | 41 | 42 | -------------------------------------------------------------------------------- /loggin demo/supperwidget/supperlabel.kv: -------------------------------------------------------------------------------- 1 | : 2 | 3 | italic: True 4 | text_size: self.size 5 | halign: "center" 6 | valign: "middle" 7 | type_speed: 0.1 8 | background_color: 0, 0, 0, 0 9 | 10 | canvas.before: 11 | Color: 12 | rgba: 1, 1, 1, 1 13 | 14 | RoundedRectangle: 15 | size: root.size 16 | pos: root.pos 17 | radius:[root.size[1]/2, root.size[1]/2,root.size[1]/2,root.size[1]/2] 18 | texture: Gradient.horizontal(get_color_from_hex(root.gr_left), get_color_from_hex(root.gr_right)) 19 | 20 | Color: 21 | rgba: root.border_color 22 | 23 | Line: 24 | width: root.border_width 25 | points: (root.pos[0]+ root.size[1]/2, root.pos[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]) 26 | 27 | Line: 28 | width: root.border_width 29 | circle: (root.pos[0]+ root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, -180 ) 30 | 31 | Line: 32 | width: root.border_width 33 | points: (root.pos[0]+ root.size[1]/2, root.pos[1] + root.size[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1] + root.size[1]) 34 | 35 | Line: 36 | width: root.border_width 37 | circle: (root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, 180 ) 38 | -------------------------------------------------------------------------------- /git_mapview/first_part/main.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.button import Button 2 | from kivy.app import App 3 | from kivy_garden.mapview import MapView, MapMarkerPopup, MapMarker, MapSource 4 | from kivy.uix.label import Label 5 | from kivy.uix.screenmanager import ScreenManager, Screen 6 | from kivy.uix.widget import Widget 7 | 8 | 9 | 10 | class fscreen(Widget): 11 | def __init__(self, **kwargs): 12 | super().__init__(**kwargs) 13 | 14 | self.ids.main_map.zoom = 15 15 | self.ids.main_map.center_on(36.5924, 2.9898) 16 | 17 | self.pin = MapMarkerPopup(lat=36.59248 ,lon=2.9898 ,source='me_32.png') 18 | self.btn = Button(size= (self.width*0.2, self.height*0.05), pos=(self.pin.pos[0], self.pin.pos[1]), on_press=self.show) 19 | self.pin.add_widget(self.btn) 20 | 21 | self.ids.main_map.add_widget(self.pin) 22 | 23 | 24 | 25 | def show(self, instance): 26 | print(str(self.pin.lat)+ ' | '+ str(self.pin.lon)) 27 | 28 | 29 | pass 30 | class theapp(App): 31 | def build(self): 32 | 33 | self.screenm = ScreenManager() 34 | 35 | self.fscreen = fscreen() 36 | screen = Screen(name = "first screen") 37 | screen.add_widget(self.fscreen) 38 | self.screenm.add_widget(screen) 39 | 40 | 41 | return self.screenm 42 | 43 | if __name__ == "__main__": 44 | theapp = theapp() 45 | theapp.run() 46 | -------------------------------------------------------------------------------- /git.kivy_date/supperwidget/supperbutton.kv: -------------------------------------------------------------------------------- 1 | : 2 | 3 | italic: True 4 | text_size: self.size 5 | halign: "center" 6 | valign: "middle" 7 | on_press: root.pressed() 8 | color: 0, 0, 0, 1 9 | background_color: 0, 0, 0, 0 10 | 11 | canvas.before: 12 | Color: 13 | rgba: 1, 1, 1, 1 14 | 15 | RoundedRectangle: 16 | size: root.size 17 | pos: root.pos 18 | radius:[root.size[1]/2, root.size[1]/2,root.size[1]/2,root.size[1]/2] 19 | texture: Gradient.horizontal(get_color_from_hex(root.gr_left),get_color_from_hex(root.gr_middle), get_color_from_hex(root.gr_right)) 20 | 21 | 22 | Color: 23 | rgba: root.border_color 24 | 25 | Line: 26 | width: root.border_width 27 | points: (root.pos[0]+ root.size[1]/2, root.pos[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]) 28 | 29 | Line: 30 | width: root.border_width 31 | circle: (root.pos[0]+ root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, -180 ) 32 | 33 | Line: 34 | width: root.border_width 35 | points: (root.pos[0]+ root.size[1]/2, root.pos[1] + root.size[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1] + root.size[1]) 36 | 37 | Line: 38 | width: root.border_width 39 | circle: (root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, 180 ) 40 | -------------------------------------------------------------------------------- /loggin demo/supperwidget/supperbutton.kv: -------------------------------------------------------------------------------- 1 | : 2 | 3 | italic: True 4 | text_size: self.size 5 | halign: "center" 6 | valign: "middle" 7 | on_press: root.pressed() 8 | color: 0, 0, 0, 1 9 | background_color: 0, 0, 0, 0 10 | 11 | canvas.before: 12 | Color: 13 | rgba: 1, 1, 1, 1 14 | 15 | RoundedRectangle: 16 | size: root.size 17 | pos: root.pos 18 | radius:[root.size[1]/2, root.size[1]/2,root.size[1]/2,root.size[1]/2] 19 | texture: Gradient.horizontal(get_color_from_hex(root.gr_left),get_color_from_hex(root.gr_middle), get_color_from_hex(root.gr_right)) 20 | 21 | 22 | Color: 23 | rgba: root.border_color 24 | 25 | Line: 26 | width: root.border_width 27 | points: (root.pos[0]+ root.size[1]/2, root.pos[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]) 28 | 29 | Line: 30 | width: root.border_width 31 | circle: (root.pos[0]+ root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, -180 ) 32 | 33 | Line: 34 | width: root.border_width 35 | points: (root.pos[0]+ root.size[1]/2, root.pos[1] + root.size[1], root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1] + root.size[1]) 36 | 37 | Line: 38 | width: root.border_width 39 | circle: (root.pos[0] + root.size[0] - root.size[1]/2, root.pos[1]+ root.size[1]/2, root.size[1]/2, 0, 180 ) 40 | -------------------------------------------------------------------------------- /git.kivy_class_variable/the.kv: -------------------------------------------------------------------------------- 1 | 2 | Label: 3 | text: 'this is the first screen' 4 | font_size: root.height*0.05 5 | size: root.width*0.4, root.height*0.5 6 | pos: root.width*0.3, root.height*0.5 7 | 8 | Button: 9 | text: 'switch screen' 10 | size: root.width*0.2, root.height*0.05 11 | pos: root.width*0.4, root.height*0.2 12 | on_press: root.change() 13 | 14 | 15 | Label: 16 | id: lb 17 | text: '' 18 | font_size: root.height*0.05 19 | size: root.width*0.4, root.height*0.35 20 | pos: root.width*0.3, root.height*0.5 21 | 22 | 23 | Button: 24 | text: 'change color' 25 | size: root.width*0.2, root.height*0.05 26 | pos: root.width*0.4, root.height*0.25 27 | on_press: root.change_color() 28 | 29 | 30 | 31 | 32 | Label: 33 | text: 'this is the second screen' 34 | font_size: root.height*0.05 35 | size: root.width*0.4, root.height*0.5 36 | pos: root.width*0.3, root.height*0.5 37 | 38 | Button: 39 | text: 'switch screen' 40 | size: root.width*0.2, root.height*0.05 41 | pos: root.width*0.4, root.height*0.2 42 | on_press: root.change() 43 | 44 | Label: 45 | id: lb 46 | text: '' 47 | font_size: root.height*0.05 48 | size: root.width*0.4, root.height*0.35 49 | pos: root.width*0.3, root.height*0.5 50 | 51 | Button: 52 | text: 'change color' 53 | size: root.width*0.2, root.height*0.05 54 | pos: root.width*0.4, root.height*0.25 55 | on_press: root.change_color() -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.size 9 | 10 | 11 | Label: 12 | color: 0, 0, 0, 1 13 | text: 'Welcome to chatapp' 14 | size: root.width*0.2, root.height*0.05 15 | pos: root.width*0.4, root.height*0.9 16 | font_size: root.height*0.04 17 | font_name: '1.ttf' 18 | 19 | 20 | TextInput: 21 | id: user_id 22 | size: root.width*0.2, root.height*0.05 23 | pos: root.width*0.4, root.height*0.6 24 | hint_text: ' Enter username' 25 | halign: 'center' 26 | font_name: '1.ttf' 27 | 28 | TextInput: 29 | id: ip_id 30 | size: root.width*0.2, root.height*0.05 31 | pos: root.width*0.4, root.height*0.5 32 | hint_text: ' Enter username' 33 | halign: 'center' 34 | font_name: '1.ttf' 35 | 36 | TextInput: 37 | id: port_id 38 | size: root.width*0.2, root.height*0.05 39 | pos: root.width*0.4, root.height*0.4 40 | hint_text: ' Enter username' 41 | halign: 'center' 42 | font_name: '1.ttf' 43 | 44 | 45 | Button: 46 | text: 'connect' 47 | size: root.width*0.2, root.height*0.05 48 | pos: root.width*0.4, root.height*0.3 49 | on_press: root.initiate() 50 | 51 | 52 | 53 | 54 | canvas.before: 55 | Color: 56 | rgba: 1, 1, 1, 1 57 | 58 | Rectangle: 59 | size: root.size 60 | 61 | 62 | Label: 63 | id: head_id 64 | color: 0, 0, 0, 65 | size: root.width*0.2, root.height*0.05 66 | pos: root.width*0.4, root.height*0.9 67 | font_size: root.height*0.025 68 | font_name: '1.ttf' 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /git_kivy_threads/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | 3 | import kivy 4 | 5 | from kivy.app import App 6 | from kivy.uix.label import Label 7 | from kivy.uix.button import Button 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.widget import Widget 10 | from kivy.uix.textinput import TextInput 11 | from kivy.clock import Clock 12 | from kivy.uix.image import Image 13 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 14 | from kivy.core.window import Window 15 | from kivy.config import Config 16 | from kivy.lang import Builder 17 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 18 | from kivy.graphics.texture import Texture 19 | import time 20 | import threading 21 | 22 | 23 | cnt = 0 24 | 25 | def some_func(): 26 | global cnt 27 | while True: 28 | time.sleep(1) 29 | cnt += 1 30 | 31 | thread_1 = threading.Thread(target = some_func) 32 | 33 | class fscreen(Widget): 34 | def __init__(self, **kwargs): 35 | global cnt 36 | super().__init__(**kwargs) 37 | 38 | Clock.schedule_interval(self.get_fromthread, 1) 39 | 40 | def get_fromthread(self, *args): 41 | 42 | self.ids.lbl.text = 'the count from the outer thread is ' + str(cnt) 43 | 44 | 45 | 46 | class theapp(App): 47 | def build(self): 48 | self.screenm = ScreenManager() 49 | 50 | self.fscreen = fscreen() 51 | screen = Screen(name = "first screen") 52 | screen.add_widget(self.fscreen) 53 | self.screenm.add_widget(screen) 54 | 55 | return self.screenm 56 | 57 | if __name__ == "__main__": 58 | theapp = theapp() 59 | 60 | thread_1.start() 61 | threading.Thread(target = theapp.run()) -------------------------------------------------------------------------------- /loggin demo/supperwidget/supperlabel.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.label import Label 2 | from kivy.clock import Clock 3 | from kivy.properties import NumericProperty, StringProperty, ListProperty 4 | from kivy.utils import get_color_from_hex 5 | from kivy_gradient import Gradient 6 | 7 | 8 | #### when modifying the text.property do 9 | 10 | 11 | class SupperLabel(Label): 12 | gr_left = StringProperty() 13 | gr_middle = StringProperty() 14 | gr_right = StringProperty() 15 | border_width = NumericProperty(1) 16 | border_color = ListProperty([0, 0, 0, 1]) 17 | 18 | def __init__(self, **kwargs): 19 | super().__init__(**kwargs) 20 | self.text_saved = None 21 | self.letters_list = [] 22 | self.cnt_anim = 0 23 | self.first_capture = False 24 | 25 | def animate_text(self, *args): 26 | if self.cnt_anim < len(self.letters_list): 27 | self.text = self.text[:-1] 28 | self.text = self.text + self.letters_list[self.cnt_anim] 29 | self.cnt_anim += 1 30 | self.text = self.text + "_" 31 | 32 | elif self.cnt_anim >= len(self.letters_list): 33 | self.text = self.text[:-1] 34 | Clock.unschedule(self.animate_text) 35 | 36 | def on_size(self, *args): 37 | if self.width > 100: 38 | if self.first_capture == False: 39 | self.first_capture = True 40 | self.text_saved = self.text 41 | 42 | Clock.unschedule(self.animate_text) 43 | self.text = "" 44 | self.letters_list = list(self.text_saved) 45 | self.cnt_anim = 0 46 | Clock.schedule_interval(self.animate_text, self.type_speed) 47 | -------------------------------------------------------------------------------- /git_kivy_filechooser/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | class fscreen(Widget): 33 | def __init__(self, **kwargs): 34 | super().__init__(**kwargs) 35 | 36 | def select_file(self): 37 | from plyer import filechooser 38 | filechooser.open_file(on_selection = self.selected) 39 | 40 | def selected(self, selection): 41 | print(selection[0]) 42 | self.ids.bck.source = selection[0] 43 | 44 | 45 | 46 | class theapp(App): 47 | def build(self): 48 | 49 | self.screenm = ScreenManager() 50 | 51 | self.fscreen = fscreen() 52 | screen = Screen(name = "first screen") 53 | screen.add_widget(self.fscreen) 54 | self.screenm.add_widget(screen) 55 | 56 | return self.screenm 57 | 58 | if __name__ == "__main__": 59 | theapp = theapp() 60 | theapp.run() -------------------------------------------------------------------------------- /git_mapview/second_part/main.py: -------------------------------------------------------------------------------- 1 | 2 | import kivy 3 | from kivy.uix.gridlayout import GridLayout 4 | from kivy.app import App 5 | from kivy.uix.label import Label 6 | from kivy.uix.button import Button 7 | from kivy.uix.screenmanager import ScreenManager, Screen 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.widget import Widget 10 | from kivy.clock import Clock 11 | from kivy.uix.image import Image 12 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 13 | from kivy.core.window import Window 14 | from kivy.config import Config 15 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 16 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 17 | from functools import partial 18 | from kivy.graphics.texture import Texture 19 | from kivy.uix.image import Image 20 | from kivy.uix.textinput import TextInput 21 | from kivy_garden.mapview import MapView, MapMarkerPopup, MapMarker, MapSource 22 | 23 | 24 | class fscreen(Widget): 25 | my_avat = StringProperty() 26 | def __init__(self, **kwargs): 27 | super().__init__(**kwargs) 28 | 29 | self.ids.main_map.zoom = 15 30 | self.ids.main_map.center_on(self.ids.main_map_me.lat, self.ids.main_map_me.lon) 31 | self.my_avat = 'avatar.png' 32 | 33 | 34 | 35 | def press(self): 36 | print(str(self.ids.main_map_me.lat) + ' | ' + str(self.ids.main_map_me.lon)) 37 | 38 | 39 | 40 | 41 | 42 | class theapp(App): 43 | def build(self): 44 | 45 | self.screenm = ScreenManager() 46 | 47 | self.fscreen = fscreen() 48 | screen = Screen(name = "first screen") 49 | screen.add_widget(self.fscreen) 50 | self.screenm.add_widget(screen) 51 | 52 | 53 | return self.screenm 54 | 55 | if __name__ == "__main__": 56 | theapp = theapp() 57 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_changebyid/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | 40 | 41 | def change(self): 42 | self.ids.lb.text = ' i habe been changed' 43 | self.ids.lb.pos[0] = self.width*0.2 44 | self.ids.lb.pos[1] = self.height*0.4 45 | self.ids.lb.color = [1, 0, 0, 1] 46 | 47 | class theapp(App): 48 | def build(self): 49 | 50 | self.screenm = ScreenManager() 51 | 52 | self.fscreen = fscreen() 53 | screen = Screen(name = "first screen") 54 | screen.add_widget(self.fscreen) 55 | self.screenm.add_widget(screen) 56 | 57 | return self.screenm 58 | 59 | if __name__ == "__main__": 60 | theapp = theapp() 61 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_properties/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty, ListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import numpy as np 26 | import time 27 | from datetime import datetime 28 | import random 29 | from plyer import notification 30 | 31 | 32 | class welcomescreen(Widget): 33 | string_example = StringProperty() 34 | numeric_example = NumericProperty() 35 | list_example = ListProperty([0, 0, 0, 0]) 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | self.string_example = 'changed by string property' 40 | self.numeric_example = 40 41 | self.list_example = [1, 0, 0, 1] 42 | 43 | 44 | 45 | 46 | 47 | class theapp(App): 48 | def build(self): 49 | self.screenm = ScreenManager(transition=FadeTransition()) 50 | self.welcomescreen = welcomescreen() 51 | screen = Screen(name = "welcomescreen") 52 | screen.add_widget(self.welcomescreen) 53 | self.screenm.add_widget(screen) 54 | 55 | return self.screenm 56 | 57 | if __name__ == "__main__": 58 | 59 | theapp = theapp() 60 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_screen_manager/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | def change(self): 40 | 41 | theapp.screenm.current = 'second screen' 42 | 43 | 44 | class secscreen(Widget): 45 | def __init__(self, **kwargs): 46 | super().__init__(**kwargs) 47 | 48 | def change(self): 49 | 50 | theapp.screenm.current = 'first screen' 51 | 52 | 53 | class theapp(App): 54 | def build(self): 55 | 56 | self.screenm = ScreenManager() 57 | 58 | 59 | 60 | self.fscreen = fscreen() 61 | screen = Screen(name = "first screen") 62 | screen.add_widget(self.fscreen) 63 | self.screenm.add_widget(screen) 64 | 65 | 66 | self.secscreen = secscreen() 67 | screen = Screen(name = "second screen") 68 | screen.add_widget(self.secscreen) 69 | self.screenm.add_widget(screen) 70 | 71 | 72 | return self.screenm 73 | 74 | if __name__ == "__main__": 75 | theapp = theapp() 76 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_chatapp/part_1/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import threading 26 | import time 27 | from datetime import datetime 28 | import socket 29 | from requests import get 30 | 31 | 32 | 33 | class welcomescreen(Widget): 34 | def __init__(self, **kwargs): 35 | super().__init__(**kwargs) 36 | 37 | 38 | 39 | def initiate(self): 40 | 41 | theapp.mainscreen.ids.head_id.text = 'chat is opened with: ' + self.ids.ip_id.text + ' at port: ' + self.ids.port_id.text 42 | theapp.screenm.current = 'mainscreen' 43 | 44 | 45 | 46 | class mainscreen(Widget): 47 | def __init__(self, **kwargs): 48 | super().__init__(**kwargs) 49 | 50 | 51 | 52 | 53 | 54 | class theapp(App): 55 | def build(self): 56 | self.screenm = ScreenManager(transition=FadeTransition()) 57 | self.welcomescreen = welcomescreen() 58 | screen = Screen(name = "welcomescreen") 59 | screen.add_widget(self.welcomescreen) 60 | self.screenm.add_widget(screen) 61 | 62 | self.mainscreen = mainscreen() 63 | screen = Screen(name = "mainscreen") 64 | screen.add_widget(self.mainscreen) 65 | self.screenm.add_widget(screen) 66 | 67 | return self.screenm 68 | 69 | if __name__ == "__main__": 70 | theapp = theapp() 71 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_notification/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import numpy as np 26 | import time 27 | from datetime import datetime 28 | import random 29 | from plyer import notification 30 | 31 | 32 | class welcomescreen(Widget): 33 | def __init__(self, **kwargs): 34 | super().__init__(**kwargs) 35 | 36 | def notifyme(self): 37 | self.body = self.ids.inp.text 38 | 39 | notification.notify(title='NOTICATION TEST', message=self.body, app_icon='/home/odr/Desktop/DEV/Tutorials/kivy/notification/python.png') 40 | 41 | 42 | 43 | 44 | 45 | class mainscreen(Widget): 46 | def __init__(self, **kwargs): 47 | super().__init__(**kwargs) 48 | 49 | 50 | 51 | class theapp(App): 52 | def build(self): 53 | self.screenm = ScreenManager(transition=FadeTransition()) 54 | self.welcomescreen = welcomescreen() 55 | screen = Screen(name = "welcomescreen") 56 | screen.add_widget(self.welcomescreen) 57 | self.screenm.add_widget(screen) 58 | 59 | self.mainscreen = mainscreen() 60 | screen = Screen(name = "mainscreen") 61 | screen.add_widget(self.mainscreen) 62 | self.screenm.add_widget(screen) 63 | 64 | return self.screenm 65 | 66 | if __name__ == "__main__": 67 | 68 | theapp = theapp() 69 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_list_of_widgets/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | self.list_of_btns = [] 40 | 41 | 42 | def create(self): 43 | self.h = self.height*0.9 44 | for i in range(4): 45 | self.h = self.h - self.height*0.1 46 | self.btn = Button(text='button '+str(i), size=(self.width*0.4, self.height*0.05), pos=(self.width*0.3, self.h), on_press=self.press) 47 | self.list_of_btns.append(self.btn) 48 | self.add_widget(self.btn) 49 | 50 | 51 | def press(self, instance): 52 | print(instance.text) 53 | 54 | 55 | def delete(self): 56 | for btns in self.list_of_btns: 57 | self.remove_widget(btns) 58 | 59 | 60 | class theapp(App): 61 | def build(self): 62 | 63 | self.screenm = ScreenManager() 64 | 65 | self.fscreen = fscreen() 66 | screen = Screen(name = "first screen") 67 | screen.add_widget(self.fscreen) 68 | self.screenm.add_widget(screen) 69 | 70 | 71 | return self.screenm 72 | 73 | if __name__ == "__main__": 74 | theapp = theapp() # 75 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_chatapp/part_2/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import threading 26 | import time 27 | from datetime import datetime 28 | import socket 29 | from requests import get 30 | 31 | 32 | 33 | class welcomescreen(Widget): 34 | def __init__(self, **kwargs): 35 | super().__init__(**kwargs) 36 | 37 | 38 | 39 | def initiate(self): 40 | 41 | theapp.mainscreen.ids.head_id.text = 'chat is opened with: ' + self.ids.ip_id.text + ' at port: ' + self.ids.port_id.text 42 | theapp.screenm.current = 'mainscreen' 43 | 44 | 45 | 46 | class mainscreen(Widget): 47 | def __init__(self, **kwargs): 48 | super().__init__(**kwargs) 49 | 50 | 51 | 52 | def send_msg(self): 53 | self.ids.chat_text_id.text = self.ids.chat_text_id.text + '\n' + theapp.welcomescreen.ids.user_id.text +' : ' + self.ids.msg_id.text 54 | 55 | 56 | 57 | 58 | class theapp(App): 59 | def build(self): 60 | self.screenm = ScreenManager(transition=FadeTransition()) 61 | self.welcomescreen = welcomescreen() 62 | screen = Screen(name = "welcomescreen") 63 | screen.add_widget(self.welcomescreen) 64 | self.screenm.add_widget(screen) 65 | 66 | self.mainscreen = mainscreen() 67 | screen = Screen(name = "mainscreen") 68 | screen.add_widget(self.mainscreen) 69 | self.screenm.add_widget(screen) 70 | 71 | return self.screenm 72 | 73 | if __name__ == "__main__": 74 | theapp = theapp() 75 | theapp.run() -------------------------------------------------------------------------------- /git_kivy_btnimage/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | 40 | def press(self): 41 | print('hello') 42 | 43 | 44 | 45 | class secscreen(Widget): 46 | 47 | def __init__(self,**kwargs): 48 | super().__init__(**kwargs) 49 | pass 50 | class thscreen(Widget): 51 | 52 | def __init__(self,**kwargs): 53 | super().__init__(**kwargs) 54 | pass 55 | class theapp(App): 56 | def build(self): 57 | 58 | self.screenm = ScreenManager() #(transition=FadeTransition()) 59 | 60 | self.fscreen = fscreen() 61 | screen = Screen(name = "first screen") 62 | screen.add_widget(self.fscreen) 63 | self.screenm.add_widget(screen) 64 | 65 | self.secscreen = secscreen() 66 | screen = Screen(name = "secondscreen") 67 | screen.add_widget(self.secscreen) 68 | self.screenm.add_widget(screen) 69 | 70 | self.thscreen = thscreen() 71 | screen = Screen(name = "thirdscreen") 72 | screen.add_widget(self.thscreen) 73 | self.screenm.add_widget(screen) 74 | return self.screenm 75 | 76 | if __name__ == "__main__": 77 | theapp = theapp() ########### LISTING THREAD 78 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_class_variable/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.boxlayout import BoxLayout 11 | from kivy.uix.widget import Widget 12 | from kivy.uix.textinput import TextInput 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 16 | from kivy.core.window import Window 17 | from kivy.config import Config 18 | from kivy.lang import Builder 19 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 20 | from kivy.graphics.texture import Texture 21 | from kivy.core.camera import Camera 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | from pathlib import Path 26 | #import cv2 27 | import struct 28 | import threading 29 | import pickle 30 | 31 | Builder.load_file('the.kv') 32 | 33 | 34 | class fscreen(Widget): 35 | def __init__(self, **kwargs): 36 | super().__init__(**kwargs) 37 | 38 | def change(self): 39 | theapp.screenm.current = 'second screen' 40 | 41 | 42 | def change_color(self): 43 | theapp.secscreen.ids.lb.color = [1, 0, 0,1] 44 | theapp.secscreen.ids.lb.text = 'color has been changed' 45 | 46 | 47 | 48 | 49 | class secscreen(Widget): 50 | def __init__(self, **kwargs): 51 | super().__init__(**kwargs) 52 | 53 | def change(self): 54 | theapp.screenm.current = 'first screen' 55 | 56 | def change_color(self): 57 | theapp.fscreen.ids.lb.color = [1, 0, 0,1] 58 | theapp.fscreen.ids.lb.text = 'color has been changed' 59 | 60 | 61 | class theapp(App): 62 | def build(self): 63 | 64 | self.screenm = ScreenManager() 65 | self.fscreen = fscreen() 66 | screen = Screen(name = "first screen") 67 | screen.add_widget(self.fscreen) 68 | self.screenm.add_widget(screen) 69 | 70 | self.secscreen = secscreen() 71 | screen = Screen(name = "second screen") 72 | screen.add_widget(self.secscreen) 73 | self.screenm.add_widget(screen) 74 | 75 | return self.screenm 76 | 77 | if __name__ == "__main__": 78 | theapp = theapp() 79 | theapp.run() 80 | -------------------------------------------------------------------------------- /git_kivy_scrollview/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | 39 | def push_me(self): 40 | 41 | self.ids.output.text = self.ids.output.text + '\n' + self.ids.input.text 42 | 43 | 44 | 45 | 46 | class secscreen(Widget): 47 | 48 | def __init__(self,**kwargs): 49 | super().__init__(**kwargs) 50 | pass 51 | class thscreen(Widget): 52 | 53 | def __init__(self,**kwargs): 54 | super().__init__(**kwargs) 55 | pass 56 | class theapp(App): 57 | def build(self): 58 | 59 | self.screenm = ScreenManager() #(transition=FadeTransition()) 60 | 61 | self.fscreen = fscreen() 62 | screen = Screen(name = "first screen") 63 | screen.add_widget(self.fscreen) 64 | self.screenm.add_widget(screen) 65 | 66 | self.secscreen = secscreen() 67 | screen = Screen(name = "secondscreen") 68 | screen.add_widget(self.secscreen) 69 | self.screenm.add_widget(screen) 70 | 71 | self.thscreen = thscreen() 72 | screen = Screen(name = "thirdscreen") 73 | screen.add_widget(self.thscreen) 74 | self.screenm.add_widget(screen) 75 | return self.screenm 76 | 77 | if __name__ == "__main__": 78 | theapp = theapp() ########### LISTING THREAD 79 | theapp.run() -------------------------------------------------------------------------------- /loggin demo/supperwidget/suppertextinput.kv: -------------------------------------------------------------------------------- 1 | 2 | : 3 | 4 | color: 0, 0, 0, 1 5 | hint_text_color: 0, 0, 0, 1 6 | background_color: 0, 0, 0, 0 7 | foreground_color: (1, 1, 1, 1) 8 | halign: "center" 9 | valign: "middle" 10 | padding_y: [(self.size[1] - self.font_size)/4,(self.size[1] - self.font_size)/4 ] 11 | 12 | multiline: False 13 | readonly: False 14 | on_focus: self.focused_anim(self.size, self.pos) 15 | canvas.before: 16 | Color: 17 | rgba: 1, 1, 1, 1 18 | RoundedRectangle: 19 | #size: self.rec_x - self.border_width*2 , self.size[1] -self.border_width*2 20 | size: self.size[0] - self.border_width*2 , self.size[1] -self.border_width*2 21 | 22 | #pos: self.rec_px + self.border_width/2, self.pos[1] + self.border_width/2 23 | pos: self.pos[0] + self.border_width/2, self.pos[1] + self.border_width/2 24 | 25 | texture: Gradient.horizontal(get_color_from_hex(self.gr_left),get_color_from_hex(self.gr_middle), get_color_from_hex(self.gr_right)) 26 | 27 | radius: [self.size[1]/2,self.size[1]/2,self.size[1]/2,self.size[1]/2] 28 | 29 | Color: 30 | rgba: self.underline_color 31 | Line: 32 | width: self.underline_width 33 | #points: (self.pos[0] + 20, self.pos[1]+4, self.pos[0]+self.size[0]-20, self.pos[1]+4) 34 | points: (self.start_x, self.pos[1] + self.line_h, self.end_x, self.pos[1] + self.line_h) 35 | Rectangle: 36 | 37 | size: root.sz_x, root.sz_y ###### this is the icon size ### also this 64 38 | pos: self.pos[0] - self.icon_offset, self.pos[1] + (self.size[1]- root.sz_y)/2 39 | source: self.icon_source if hasattr(self, 'icon_source') else '' 40 | source: self.icon_source 41 | 42 | Color: 43 | rgba: self.border_color 44 | 45 | Line: 46 | width: self.border_width 47 | points: (self.pos[0]+ self.size[1]/2, self.pos[1], self.pos[0] + self.size[0] - self.size[1]/2, self.pos[1]) 48 | 49 | Line: 50 | width: self.border_width 51 | circle: (self.pos[0]+ self.size[1]/2, self.pos[1]+ self.size[1]/2, self.size[1]/2, 0, -180 ) 52 | 53 | Line: 54 | width: self.border_width 55 | points: (self.pos[0]+ self.size[1]/2, self.pos[1] + self.size[1], self.pos[0] + self.size[0] - self.size[1]/2, self.pos[1] + self.size[1]) 56 | 57 | Line: 58 | width: self.border_width 59 | circle: (self.pos[0] + self.size[0] - self.size[1]/2, self.pos[1]+ self.size[1]/2, self.size[1]/2, 0, 180 ) 60 | 61 | 62 | -------------------------------------------------------------------------------- /git_kivy_clock/main.py: -------------------------------------------------------------------------------- 1 | import socket 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | 6 | from kivy.uix.gridlayout import GridLayout 7 | from kivy.app import App 8 | from kivy.uix.label import Label 9 | from kivy.uix.button import Button 10 | from kivy.uix.screenmanager import ScreenManager, Screen 11 | from kivy.uix.boxlayout import BoxLayout 12 | from kivy.uix.widget import Widget 13 | from kivy.uix.textinput import TextInput 14 | from kivy.clock import Clock 15 | from kivy.uix.image import Image 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.core.camera import Camera 23 | from kivy.graphics import * 24 | import time 25 | import os 26 | from pathlib import Path 27 | #import cv2 28 | import struct 29 | import threading 30 | import pickle 31 | 32 | Builder.load_file('the.kv') 33 | 34 | 35 | class fscreen(Widget): 36 | def __init__(self, **kwargs): 37 | super().__init__(**kwargs) 38 | self.count = 0 39 | 40 | 41 | 42 | 43 | def update_label(self, *args): 44 | self.count = self.count + 1 45 | self.ids.lb.text = 'function has beenn called :' + str(self.count) + ' times' 46 | 47 | 48 | def stop(self): 49 | Clock.unschedule(self.update_label) 50 | 51 | 52 | def start(self): 53 | Clock.schedule_interval(self.update_label, 0.5) 54 | 55 | class secscreen(Widget): 56 | 57 | def __init__(self,**kwargs): 58 | super().__init__(**kwargs) 59 | pass 60 | class thscreen(Widget): 61 | 62 | def __init__(self,**kwargs): 63 | super().__init__(**kwargs) 64 | pass 65 | class theapp(App): 66 | def build(self): 67 | 68 | self.screenm = ScreenManager() #(transition=FadeTransition()) 69 | 70 | self.fscreen = fscreen() 71 | screen = Screen(name = "first screen") 72 | screen.add_widget(self.fscreen) 73 | self.screenm.add_widget(screen) 74 | 75 | self.secscreen = secscreen() 76 | screen = Screen(name = "secondscreen") 77 | screen.add_widget(self.secscreen) 78 | self.screenm.add_widget(screen) 79 | 80 | self.thscreen = thscreen() 81 | screen = Screen(name = "thirdscreen") 82 | screen.add_widget(self.thscreen) 83 | self.screenm.add_widget(screen) 84 | return self.screenm 85 | 86 | if __name__ == "__main__": 87 | theapp = theapp() ########### LISTING THREAD 88 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_chatapp/part_2/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.size 9 | 10 | 11 | Label: 12 | color: 0, 0, 0, 1 13 | text: 'Welcome to chatapp' 14 | size: root.width*0.2, root.height*0.05 15 | pos: root.width*0.4, root.height*0.9 16 | font_size: root.height*0.04 17 | font_name: '1.ttf' 18 | 19 | 20 | TextInput: 21 | id: user_id 22 | size: root.width*0.2, root.height*0.05 23 | pos: root.width*0.4, root.height*0.6 24 | hint_text: ' Enter username' 25 | halign: 'center' 26 | font_name: '1.ttf' 27 | 28 | TextInput: 29 | id: ip_id 30 | size: root.width*0.2, root.height*0.05 31 | pos: root.width*0.4, root.height*0.5 32 | hint_text: 'Enter IP' 33 | halign: 'center' 34 | font_name: '1.ttf' 35 | 36 | TextInput: 37 | id: port_id 38 | size: root.width*0.2, root.height*0.05 39 | pos: root.width*0.4, root.height*0.4 40 | hint_text: ' Enter Port' 41 | halign: 'center' 42 | font_name: '1.ttf' 43 | 44 | 45 | Button: 46 | text: 'connect' 47 | size: root.width*0.2, root.height*0.05 48 | pos: root.width*0.4, root.height*0.3 49 | on_press: root.initiate() 50 | 51 | 52 | 53 | 54 | canvas.before: 55 | Color: 56 | rgba: 1, 1, 1, 1 57 | 58 | Rectangle: 59 | size: root.size 60 | 61 | Color: 62 | rgba: 0.8, 0.8, 0.8, 1 63 | 64 | Rectangle: 65 | size: root.width*0.6, root.height*0.7 66 | pos: root.width*0.2, root.height*0.2 67 | 68 | Label: 69 | id: head_id 70 | color: 0, 0, 0, 71 | size: root.width*0.2, root.height*0.05 72 | pos: root.width*0.4, root.height*0.9 73 | font_size: root.height*0.025 74 | font_name: '1.ttf' 75 | 76 | 77 | ScrollView: 78 | size: root.width*0.6, root.height*0.7 79 | pos: root.width*0.2, root.height*0.2 80 | 81 | 82 | Label: 83 | id: chat_text_id 84 | color: 0, 0, 0, 1 85 | size_hint_x: 1.0 86 | size_hint_y: None 87 | text_size: self.width, None 88 | height: self.texture_size[1] 89 | font_name: '1.ttf' 90 | 91 | 92 | TextInput: 93 | id: msg_id 94 | size: root.width*0.55, root.height*0.05 95 | pos: root.width*0.2, root.height*0.15 96 | font_name: '1.ttf' 97 | 98 | Button: 99 | background_color: 0, 0, 0, 0 100 | size: root.width*0.05, root.height*0.05 101 | pos: root.width*0.75, root.height*0.15 102 | on_press: root.send_msg() 103 | Image: 104 | source: 'send.png' 105 | pos: self.parent.pos 106 | size: self.parent.size 107 | allow_stretch: True 108 | 109 | -------------------------------------------------------------------------------- /git.kivy_chatapp/part_3/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.size 9 | 10 | 11 | Label: 12 | color: 0, 0, 0, 1 13 | text: 'Welcome to chatapp' 14 | size: root.width*0.2, root.height*0.05 15 | pos: root.width*0.4, root.height*0.9 16 | font_size: root.height*0.04 17 | font_name: '1.ttf' 18 | 19 | 20 | TextInput: 21 | id: user_id 22 | size: root.width*0.2, root.height*0.05 23 | pos: root.width*0.4, root.height*0.6 24 | hint_text: ' Enter username' 25 | halign: 'center' 26 | font_name: '1.ttf' 27 | 28 | TextInput: 29 | id: ip_id 30 | size: root.width*0.2, root.height*0.05 31 | pos: root.width*0.4, root.height*0.5 32 | hint_text: 'Enter IP' 33 | halign: 'center' 34 | font_name: '1.ttf' 35 | 36 | TextInput: 37 | id: port_id 38 | size: root.width*0.2, root.height*0.05 39 | pos: root.width*0.4, root.height*0.4 40 | hint_text: ' Enter Port' 41 | halign: 'center' 42 | font_name: '1.ttf' 43 | 44 | 45 | Button: 46 | text: 'connect' 47 | size: root.width*0.2, root.height*0.05 48 | pos: root.width*0.4, root.height*0.3 49 | on_press: root.initiate() 50 | 51 | 52 | 53 | 54 | canvas.before: 55 | Color: 56 | rgba: 1, 1, 1, 1 57 | 58 | Rectangle: 59 | size: root.size 60 | 61 | Color: 62 | rgba: 0.8, 0.8, 0.8, 1 63 | 64 | Rectangle: 65 | size: root.width*0.6, root.height*0.7 66 | pos: root.width*0.2, root.height*0.2 67 | 68 | Label: 69 | id: head_id 70 | color: 0, 0, 0, 71 | size: root.width*0.2, root.height*0.05 72 | pos: root.width*0.4, root.height*0.9 73 | font_size: root.height*0.025 74 | font_name: '1.ttf' 75 | 76 | 77 | ScrollView: 78 | size: root.width*0.6, root.height*0.7 79 | pos: root.width*0.2, root.height*0.2 80 | 81 | 82 | Label: 83 | id: chat_text_id 84 | color: 0, 0, 0, 1 85 | size_hint_x: 1.0 86 | size_hint_y: None 87 | text_size: self.width, None 88 | height: self.texture_size[1] 89 | font_name: '1.ttf' 90 | 91 | 92 | TextInput: 93 | id: msg_id 94 | size: root.width*0.55, root.height*0.05 95 | pos: root.width*0.2, root.height*0.15 96 | font_name: '1.ttf' 97 | 98 | Button: 99 | background_color: 0, 0, 0, 0 100 | size: root.width*0.05, root.height*0.05 101 | pos: root.width*0.75, root.height*0.15 102 | on_press: root.send_msg() 103 | Image: 104 | source: 'send.png' 105 | pos: self.parent.pos 106 | size: self.parent.size 107 | allow_stretch: True 108 | 109 | -------------------------------------------------------------------------------- /git.kivy_chatapp/part_4/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.size 9 | 10 | 11 | Label: 12 | color: 0, 0, 0, 1 13 | text: 'Welcome to chatapp' 14 | size: root.width*0.2, root.height*0.05 15 | pos: root.width*0.4, root.height*0.9 16 | font_size: root.height*0.04 17 | font_name: '1.ttf' 18 | 19 | 20 | TextInput: 21 | id: user_id 22 | size: root.width*0.2, root.height*0.05 23 | pos: root.width*0.4, root.height*0.6 24 | hint_text: ' Enter username' 25 | halign: 'center' 26 | font_name: '1.ttf' 27 | 28 | TextInput: 29 | id: ip_id 30 | size: root.width*0.2, root.height*0.05 31 | pos: root.width*0.4, root.height*0.5 32 | hint_text: 'Enter IP' 33 | halign: 'center' 34 | font_name: '1.ttf' 35 | 36 | TextInput: 37 | id: port_id 38 | size: root.width*0.2, root.height*0.05 39 | pos: root.width*0.4, root.height*0.4 40 | hint_text: ' Enter Port' 41 | halign: 'center' 42 | font_name: '1.ttf' 43 | 44 | 45 | Button: 46 | text: 'connect' 47 | size: root.width*0.2, root.height*0.05 48 | pos: root.width*0.4, root.height*0.3 49 | on_press: root.initiate() 50 | 51 | 52 | 53 | 54 | canvas.before: 55 | Color: 56 | rgba: 1, 1, 1, 1 57 | 58 | Rectangle: 59 | size: root.size 60 | 61 | Color: 62 | rgba: 0.8, 0.8, 0.8, 1 63 | 64 | Rectangle: 65 | size: root.width*0.6, root.height*0.7 66 | pos: root.width*0.2, root.height*0.2 67 | 68 | Label: 69 | id: head_id 70 | color: 0, 0, 0, 71 | size: root.width*0.2, root.height*0.05 72 | pos: root.width*0.4, root.height*0.9 73 | font_size: root.height*0.025 74 | font_name: '1.ttf' 75 | 76 | 77 | ScrollView: 78 | size: root.width*0.6, root.height*0.7 79 | pos: root.width*0.2, root.height*0.2 80 | 81 | 82 | Label: 83 | id: chat_text_id 84 | color: 0, 0, 0, 1 85 | size_hint_x: 1.0 86 | size_hint_y: None 87 | text_size: self.width, None 88 | height: self.texture_size[1] 89 | font_name: '1.ttf' 90 | 91 | 92 | TextInput: 93 | id: msg_id 94 | size: root.width*0.55, root.height*0.05 95 | pos: root.width*0.2, root.height*0.15 96 | font_name: '1.ttf' 97 | 98 | Button: 99 | background_color: 0, 0, 0, 0 100 | size: root.width*0.05, root.height*0.05 101 | pos: root.width*0.75, root.height*0.15 102 | on_press: root.send_msg() 103 | Image: 104 | source: 'send.png' 105 | pos: self.parent.pos 106 | size: self.parent.size 107 | allow_stretch: True 108 | 109 | -------------------------------------------------------------------------------- /git.kivy_chatapp/part_5/the.kv: -------------------------------------------------------------------------------- 1 | 2 | 3 | canvas.before: 4 | Color: 5 | rgba: 1, 1, 1, 1 6 | 7 | Rectangle: 8 | size: root.size 9 | 10 | 11 | Label: 12 | color: 0, 0, 0, 1 13 | text: 'Welcome to chatapp' 14 | size: root.width*0.2, root.height*0.05 15 | pos: root.width*0.4, root.height*0.9 16 | font_size: root.height*0.04 17 | font_name: '1.ttf' 18 | 19 | 20 | TextInput: 21 | id: user_id 22 | size: root.width*0.2, root.height*0.05 23 | pos: root.width*0.4, root.height*0.6 24 | hint_text: ' Enter username' 25 | halign: 'center' 26 | font_name: '1.ttf' 27 | 28 | TextInput: 29 | id: ip_id 30 | size: root.width*0.2, root.height*0.05 31 | pos: root.width*0.4, root.height*0.5 32 | hint_text: 'Enter IP' 33 | halign: 'center' 34 | font_name: '1.ttf' 35 | 36 | TextInput: 37 | id: port_id 38 | size: root.width*0.2, root.height*0.05 39 | pos: root.width*0.4, root.height*0.4 40 | hint_text: ' Enter Port' 41 | halign: 'center' 42 | font_name: '1.ttf' 43 | 44 | 45 | Button: 46 | text: 'connect' 47 | size: root.width*0.2, root.height*0.05 48 | pos: root.width*0.4, root.height*0.3 49 | on_press: root.initiate() 50 | 51 | 52 | 53 | 54 | canvas.before: 55 | Color: 56 | rgba: 1, 1, 1, 1 57 | 58 | Rectangle: 59 | size: root.size 60 | 61 | Color: 62 | rgba: 0.8, 0.8, 0.8, 1 63 | 64 | Rectangle: 65 | size: root.width*0.6, root.height*0.7 66 | pos: root.width*0.2, root.height*0.2 67 | 68 | Label: 69 | id: head_id 70 | color: 0, 0, 0, 71 | size: root.width*0.2, root.height*0.05 72 | pos: root.width*0.4, root.height*0.9 73 | font_size: root.height*0.025 74 | font_name: '1.ttf' 75 | 76 | 77 | ScrollView: 78 | size: root.width*0.6, root.height*0.7 79 | pos: root.width*0.2, root.height*0.2 80 | 81 | 82 | Label: 83 | id: chat_text_id 84 | color: 0, 0, 0, 1 85 | size_hint_x: 1.0 86 | size_hint_y: None 87 | text_size: self.width, None 88 | height: self.texture_size[1] 89 | font_name: '1.ttf' 90 | markup: True 91 | 92 | TextInput: 93 | id: msg_id 94 | size: root.width*0.55, root.height*0.05 95 | pos: root.width*0.2, root.height*0.15 96 | font_name: '1.ttf' 97 | 98 | Button: 99 | background_color: 0, 0, 0, 0 100 | size: root.width*0.05, root.height*0.05 101 | pos: root.width*0.75, root.height*0.15 102 | on_press: root.send_msg() 103 | Image: 104 | source: 'send.png' 105 | pos: self.parent.pos 106 | size: self.parent.size 107 | allow_stretch: True 108 | 109 | -------------------------------------------------------------------------------- /git_mapview/thrid_part/main.py: -------------------------------------------------------------------------------- 1 | 2 | import kivy 3 | from kivy.uix.gridlayout import GridLayout 4 | from kivy.app import App 5 | from kivy.uix.label import Label 6 | from kivy.uix.button import Button 7 | from kivy.uix.screenmanager import ScreenManager, Screen 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.widget import Widget 10 | from kivy.clock import Clock 11 | from kivy.uix.image import Image 12 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 13 | from kivy.core.window import Window 14 | from kivy.config import Config 15 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 16 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 17 | from functools import partial 18 | from kivy.graphics.texture import Texture 19 | from kivy.uix.image import Image 20 | from kivy.uix.textinput import TextInput 21 | from kivy_garden.mapview import MapView, MapMarkerPopup, MapMarker, MapSource 22 | 23 | 24 | class fscreen(Widget): 25 | my_avat = StringProperty() 26 | def __init__(self, **kwargs): 27 | super().__init__(**kwargs) 28 | 29 | self.placed = False 30 | self.exists = False 31 | 32 | 33 | self.ids.main_map.zoom = 15 34 | self.ids.main_map.center_on(self.ids.main_map_me.lat, self.ids.main_map_me.lon) 35 | self.my_avat = 'avatar.png' 36 | 37 | def press(self): 38 | print(str(self.ids.main_map_me.lat) + ' | ' + str(self.ids.main_map_me.lon)) 39 | 40 | 41 | 42 | def place_pin(self): 43 | self.placed = True 44 | 45 | def remove_pin(self): 46 | if self.exists == True: 47 | self.ids.main_map.remove_widget(self.dist) 48 | self.placed = False 49 | self.exists = False 50 | 51 | def on_touch_up(self, touch): 52 | if touch.y > self.height*0.05: 53 | if self.exists == False and self.placed == True: 54 | 55 | self.dist = MapMarkerPopup(lat=self.ids.main_map.get_latlon_at(touch.x,touch.y)[0],lon=self.ids.main_map.get_latlon_at(touch.x,touch.y)[1],source='dist.png') 56 | 57 | self.btn = Button(text = 'print loc', on_press=self.press_dist) 58 | self.dist.add_widget(self.btn) 59 | self.ids.main_map.add_widget(self.dist) 60 | print(self.ids.main_map.get_latlon_at(touch.x, touch.y)) 61 | self.exists = True 62 | 63 | 64 | def press_dist(self, instance): 65 | print(self.dist.lat) 66 | print(self.dist.lon) 67 | 68 | class theapp(App): 69 | def build(self): 70 | 71 | self.screenm = ScreenManager() 72 | 73 | self.fscreen = fscreen() 74 | screen = Screen(name = "first screen") 75 | screen.add_widget(self.fscreen) 76 | self.screenm.add_widget(screen) 77 | 78 | 79 | return self.screenm 80 | 81 | if __name__ == "__main__": 82 | theapp = theapp() 83 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_chatapp/part_3/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import threading 26 | import time 27 | from datetime import datetime 28 | import socket 29 | from requests import get 30 | 31 | 32 | 33 | 34 | def send(): 35 | pass 36 | 37 | 38 | 39 | def listen(): 40 | 41 | while listen_cond == True: 42 | try: 43 | listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 44 | listen_socket.bind(('192.168.1.107', 2003)) 45 | listen_socket.listen(10) 46 | while True: 47 | clientsocket, address = listen_socket.accept() 48 | while True: 49 | chat_recv = clientsocket.recv(1024) 50 | listen_msg = chat_recv.decode("utf-8") 51 | except: 52 | time.sleep(0.5) 53 | pirnt('binding ...') 54 | 55 | 56 | class welcomescreen(Widget): 57 | def __init__(self, **kwargs): 58 | super().__init__(**kwargs) 59 | 60 | def initiate(self): 61 | 62 | theapp.mainscreen.ids.head_id.text = 'chat is opened with: ' + self.ids.ip_id.text + ' at port: ' + self.ids.port_id.text 63 | theapp.screenm.current = 'mainscreen' 64 | 65 | class mainscreen(Widget): 66 | def __init__(self, **kwargs): 67 | super().__init__(**kwargs) 68 | 69 | def send_msg(self): 70 | self.ids.chat_text_id.text = self.ids.chat_text_id.text + '\n' + theapp.welcomescreen.ids.user_id.text +' : ' + self.ids.msg_id.text 71 | 72 | 73 | 74 | 75 | class theapp(App): 76 | def build(self): 77 | self.screenm = ScreenManager(transition=FadeTransition()) 78 | self.welcomescreen = welcomescreen() 79 | screen = Screen(name = "welcomescreen") 80 | screen.add_widget(self.welcomescreen) 81 | self.screenm.add_widget(screen) 82 | 83 | self.mainscreen = mainscreen() 84 | screen = Screen(name = "mainscreen") 85 | screen.add_widget(self.mainscreen) 86 | self.screenm.add_widget(screen) 87 | 88 | return self.screenm 89 | 90 | if __name__ == "__main__": 91 | theapp = theapp() 92 | theapp.run() 93 | -------------------------------------------------------------------------------- /git.kivy_date/the.kv: -------------------------------------------------------------------------------- 1 | #:import get_color_from_hex kivy.utils.get_color_from_hex 2 | #:import Gradient kivy_gradient.Gradient 3 | 4 | 5 | 6 | 7 | canvas.before: 8 | Color: 9 | rgba: 1, 1, 1, 1 10 | 11 | Rectangle: 12 | size: root.size 13 | pos: root.pos 14 | 15 | 16 | GridLayout: 17 | id: grid_date 18 | size: root.width*0.8, root.height*0.35 19 | pos: root.width*0.1, root.height*0.4 20 | cols: 1 21 | spacing: 50 22 | canvas.before: 23 | Color: 24 | rgba: 0, 0, 0, 0.1 25 | RoundedRectangle: 26 | size: grid_date.size[0] + 80, grid_date.size[1] + 80 27 | pos: grid_date.pos[0] - 40, grid_date.pos[1] - 40 28 | radius: [25, 25, 25, 25] 29 | 30 | 31 | Color: 32 | rgba: 0, 0, 0, 1 33 | Line: 34 | points: (grid_date.pos[0], grid_date.pos[1] + root.height*0.05,grid_date.pos[0] + root.width*0.8, grid_date.pos[1] + root.height*0.05) 35 | width: 2 36 | 37 | GridLayout: 38 | id: grid_years 39 | size_hint_y: 1/6 40 | cols: 3 41 | 42 | Button: 43 | size_hint_x: 0.1 44 | id: left_date 45 | background_color: 0, 0, 0, 0 46 | on_press: root.move('year_left') 47 | 48 | Image: 49 | source: 'resources/images/lt.png' 50 | allow_stretch: True 51 | keep_ratio: True 52 | pos: left_date.pos 53 | 54 | TextInput: 55 | id: input_year 56 | text: '2024' 57 | size_hint_x: 0.8 58 | halign: "center" 59 | valign: "middle" 60 | hint_text: '2024' 61 | padding_y: [self.height / 2.0 - (self.line_height / 2.0) * len(self._lines), 0] 62 | multiline: False 63 | font_name: 'resources/fonts/1.ttf' 64 | background_color: 0, 0, 0, 0 65 | color: 1, 1, 1, 1 66 | 67 | Button: 68 | size_hint_x: 0.1 69 | id: right_date 70 | background_color: 0, 0, 0, 0 71 | on_press: root.move('year_right') 72 | Image: 73 | source: 'resources/images/rt.png' 74 | allow_stretch: True 75 | keep_ratio: True 76 | pos: right_date.pos 77 | 78 | GridLayout: 79 | id: grid_month 80 | size_hint_y: 1/6 81 | cols: 3 82 | 83 | Button: 84 | size_hint_x: 0.1 85 | id: left_month 86 | background_color: 0, 0, 0, 0 87 | on_press: root.move('month_left') 88 | Image: 89 | source: 'resources/images/lt.png' 90 | allow_stretch: True 91 | keep_ratio: True 92 | pos: left_month.pos 93 | 94 | 95 | 96 | Label: 97 | size_hint_x: 0.8 98 | id: month_lbl 99 | color: 0, 0, 0, 1 100 | text: 'January' 101 | 102 | multiline: False 103 | font_name: 'resources/fonts/1.ttf' 104 | 105 | Button: 106 | size_hint_x: 0.1 107 | id: right_month 108 | background_color: 0, 0, 0, 0 109 | on_press: root.move('month_right') 110 | Image: 111 | source: 'resources/images/rt.png' 112 | allow_stretch: True 113 | keep_ratio: True 114 | pos: right_month.pos 115 | 116 | GridLayout: 117 | id: grid_days 118 | cols: 7 119 | spacing: 10 120 | 121 | 122 | GridLayout: 123 | size_hint_y: 1/6 124 | cols: 2 125 | spacing: 10 126 | Label: 127 | id: date_accept_lbl 128 | size_hint_x: 0.9 129 | color: 0, 0, 0, 1 130 | text: '1 January 2024' 131 | 132 | font_name: 'resources/fonts/1.ttf' 133 | 134 | Button: 135 | size_hint_x: 0.1 136 | id: valid_date 137 | background_color: 0, 0, 0, 0 138 | on_press: root.confirm_date() 139 | 140 | Image: 141 | source: 'resources/images/accept.png' 142 | allow_stretch: True 143 | keep_ratio: True 144 | pos: valid_date.pos 145 | halign: "center" 146 | valign: "middle" 147 | -------------------------------------------------------------------------------- /git.kivy_chatapp/part_4/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import threading 26 | import time 27 | from datetime import datetime 28 | import socket 29 | from requests import get 30 | 31 | 32 | remote_cond = False 33 | remote_listen = True 34 | 35 | remote_ip = '' 36 | remote_port = 0 37 | 38 | listen_msg = '' 39 | 40 | 41 | 42 | 43 | 44 | def sender(): 45 | global remote_msg, remote_ip, remote_port, remote_cond 46 | 47 | while True: 48 | try: 49 | 50 | while remote_cond == True: 51 | 52 | remote_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 53 | remote_socket.connect((remote_ip, remote_port)) 54 | print('connect') 55 | while True: 56 | if remote_msg != '': 57 | remote_socket.send(bytes(remote_msg, 'utf-8')) 58 | remote_msg = '' 59 | 60 | 61 | 62 | 63 | except: 64 | time.sleep(0.5) 65 | 66 | 67 | thread_1 = threading.Thread(target = sender) 68 | 69 | 70 | def listen(): 71 | global listen_msg, listen_cond 72 | 73 | while listen_cond == True: 74 | try: 75 | listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 76 | listen_socket.bind(('192.168.1.107', 2003)) 77 | listen_socket.listen(10) 78 | print('binded') 79 | while True: 80 | clientsocket, address = listen_socket.accept() 81 | while True: 82 | chat_recv = clientsocket.recv(1024) 83 | listen_msg = chat_recv.decode("utf-8") 84 | except: 85 | time.sleep(0.5) 86 | pirnt('binding ...') 87 | 88 | 89 | thread_2 = threading.Thread(target = listen) 90 | 91 | 92 | class welcomescreen(Widget): 93 | def __init__(self, **kwargs): 94 | super().__init__(**kwargs) 95 | 96 | def initiate(self): 97 | global remote_ip, remote_port, remote_cond 98 | remote_ip = self.ids.ip_id.text 99 | remote_port = int(self.ids.port_id.text) 100 | remote_cond = True 101 | 102 | theapp.mainscreen.ids.head_id.text = 'chat is opened with: ' + self.ids.ip_id.text + ' at port: ' + self.ids.port_id.text 103 | theapp.screenm.current = 'mainscreen' 104 | 105 | class mainscreen(Widget): 106 | def __init__(self, **kwargs): 107 | super().__init__(**kwargs) 108 | 109 | def send_msg(self): 110 | self.ids.chat_text_id.text = self.ids.chat_text_id.text + '\n' + theapp.welcomescreen.ids.user_id.text +' : ' + self.ids.msg_id.text 111 | 112 | 113 | 114 | 115 | class theapp(App): 116 | def build(self): 117 | self.screenm = ScreenManager(transition=FadeTransition()) 118 | self.welcomescreen = welcomescreen() 119 | screen = Screen(name = "welcomescreen") 120 | screen.add_widget(self.welcomescreen) 121 | self.screenm.add_widget(screen) 122 | 123 | self.mainscreen = mainscreen() 124 | screen = Screen(name = "mainscreen") 125 | screen.add_widget(self.mainscreen) 126 | self.screenm.add_widget(screen) 127 | 128 | return self.screenm 129 | 130 | if __name__ == "__main__": 131 | theapp = theapp() 132 | thread_1.start() 133 | thread_2.start() 134 | thread.Thread(target = theapp.run()) 135 | remote_cond = False 136 | listen_cond = False -------------------------------------------------------------------------------- /loggin demo/supperwidget/suppertextinput.py: -------------------------------------------------------------------------------- 1 | from kivy.uix.textinput import TextInput 2 | from kivy.clock import Clock 3 | from kivy.properties import NumericProperty, StringProperty, ListProperty 4 | from kivy.utils import get_color_from_hex 5 | from kivy_gradient import Gradient 6 | from kivy.lang import Builder 7 | 8 | # Builder.load_file('supperwidget/suppertextinput.kv') 9 | 10 | 11 | class SupperTextinput(TextInput): 12 | line_h = NumericProperty() 13 | underline_width = NumericProperty(1) #### has to be > 0 14 | underline_color = ListProperty([0, 0, 0, 1]) 15 | start_x = NumericProperty() 16 | end_x = NumericProperty() 17 | rec_x = NumericProperty() 18 | rec_px = NumericProperty() 19 | 20 | sz_x = NumericProperty(64) 21 | sz_y = NumericProperty(64) 22 | 23 | icon_offset = NumericProperty() 24 | icon_source = StringProperty() 25 | gr_left = StringProperty("#ffffff") 26 | gr_middle = StringProperty("#ffffff") 27 | 28 | gr_right = StringProperty("#ffffff") 29 | 30 | border_width = NumericProperty(1) 31 | border_color = ListProperty([0, 0, 0, 1]) 32 | 33 | def __init__(self, **kwargs): 34 | super().__init__(**kwargs) 35 | self.start_x = 0 36 | self.end_x = 0 37 | self.rec_x = 0 38 | self.rec_px = 0 39 | self.ref_pos = None 40 | self.ref_size = None 41 | 42 | def focused_anim(self, sz, ps): 43 | if self.focus == True: 44 | self.rec_x = 0 45 | self.ref_pos = ps 46 | self.ref_size = sz 47 | self.start_x = ps[0] + 100 48 | self.end_x = ps[0] + sz[0] - 100 49 | self.rec_px = ps[0] + (sz[0] / 2) 50 | self.underline_color = [0, 0, 0, 1] 51 | Clock.schedule_interval(self.canvas_rec_expand, 1 / 60) 52 | Clock.schedule_interval(self.reset_it, 1 / 30) 53 | 54 | def textinput_line_anime(self, *args): 55 | if self.start_x < self.ref_pos[0] + (self.ref_size[0] / 2) - 100: 56 | self.start_x += 4 #### this speed by which the line is moving 4px 57 | self.end_x -= 4 #### this speed by which the line is moving 4px 58 | 59 | elif self.start_x >= self.ref_pos[0] + (self.ref_size[0] / 2) - 100: 60 | Clock.schedule_interval(self.textinput_line_anime_2, 1 / 60) 61 | Clock.unschedule(self.textinput_line_anime) 62 | 63 | def textinput_line_anime_2(self, *args): 64 | if self.start_x >= self.ref_pos[0] + 100: 65 | self.start_x -= 4 #### this speed by which the line is moving 4px 66 | self.end_x += 4 #### this speed by which the line is moving 4px 67 | 68 | elif self.start_x < self.ref_pos[0] + (self.ref_size[0] / 2) - 100: 69 | Clock.schedule_interval(self.textinput_line_anime, 1 / 60) 70 | Clock.unschedule(self.textinput_line_anime_2) 71 | 72 | def canvas_rec_expand(self, *args): 73 | if self.rec_x < self.ref_size[0]: 74 | self.rec_x += 16 #### this speed by which the rec is expanding 75 | self.rec_px -= 8 #### this speed by which the rec is expanding 76 | 77 | elif self.rec_x >= self.ref_size[0]: 78 | self.rec_x = self.ref_size[0] 79 | self.rec_px = self.ref_pos[0] 80 | Clock.unschedule(self.canvas_rec_expand) 81 | Clock.schedule_interval(self.textinput_line_anime, 1 / 60) 82 | Clock.schedule_interval(self.textinput_line_anime, 1 / 60) 83 | 84 | # def on_size(self, *args): 85 | # Clock.unschedule(self.textinput_line_anime) 86 | # Clock.unschedule(self.textinput_line_anime_2) 87 | # Clock.unschedule(self.canvas_rec_expand) 88 | # self.rec_x = 0 89 | # self.focused_anim(self.size, self.pos) 90 | 91 | def reset_it(self, *args): 92 | if self.focus == False: 93 | Clock.unschedule(self.canvas_rec_expand) 94 | Clock.unschedule(self.textinput_line_anime) 95 | Clock.unschedule(self.textinput_line_anime_2) 96 | Clock.unschedule(self.reset_it) 97 | self.start_x = 0 98 | self.end_x = 0 99 | self.rec_px = self.width * 10 ##### this gets insta updated 100 | #### doesnt get updated 101 | -------------------------------------------------------------------------------- /git.kivy_chatapp/part_5/main.py: -------------------------------------------------------------------------------- 1 | 2 | import gi 3 | gi.require_version('Gst', '1.0') 4 | import kivy 5 | from kivy.uix.gridlayout import GridLayout 6 | from kivy.app import App 7 | from kivy.uix.label import Label 8 | from kivy.uix.button import Button 9 | from kivy.uix.boxlayout import BoxLayout 10 | from kivy.uix.widget import Widget 11 | from kivy.uix.textinput import TextInput 12 | from kivy.uix.popup import Popup 13 | from kivy.clock import Clock 14 | from kivy.uix.image import Image 15 | from kivy.uix.floatlayout import FloatLayout 16 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 17 | from kivy.core.window import Window 18 | from kivy.config import Config 19 | from kivy.lang import Builder 20 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 21 | from kivy.graphics.texture import Texture 22 | from kivy.graphics import * 23 | import time 24 | import os 25 | import threading 26 | import time 27 | from datetime import datetime 28 | import socket 29 | from requests import get 30 | 31 | 32 | remote_cond = False 33 | listen_cond = True 34 | 35 | remote_ip = '' 36 | remote_port = 0 37 | 38 | listen_msg = '' 39 | remote_msg = '' 40 | 41 | 42 | 43 | 44 | 45 | def sender(): 46 | global remote_msg, remote_ip, remote_port, remote_cond 47 | 48 | while True: 49 | try: 50 | 51 | while remote_cond == True: 52 | 53 | remote_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 54 | remote_socket.connect((remote_ip, remote_port)) 55 | print('connect') 56 | while True: 57 | if remote_msg != '': 58 | remote_socket.send(bytes(remote_msg, 'utf-8')) 59 | remote_msg = '' 60 | 61 | 62 | 63 | 64 | except: 65 | time.sleep(0.5) 66 | 67 | 68 | thread_1 = threading.Thread(target = sender) 69 | 70 | 71 | def listen(): 72 | global listen_msg, listen_cond 73 | 74 | while listen_cond == True: 75 | try: 76 | listen_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 77 | listen_socket.bind(('192.168.1.107', 2022)) 78 | listen_socket.listen(10) 79 | print('binded') 80 | while True: 81 | clientsocket, address = listen_socket.accept() 82 | while True: 83 | chat_recv = clientsocket.recv(1024) 84 | listen_msg = chat_recv.decode("utf-8") 85 | except: 86 | time.sleep(0.5) 87 | pirnt('binding ...') 88 | 89 | 90 | thread_2 = threading.Thread(target = listen) 91 | 92 | 93 | class welcomescreen(Widget): 94 | def __init__(self, **kwargs): 95 | super().__init__(**kwargs) 96 | 97 | def initiate(self): 98 | global remote_ip, remote_port, remote_cond 99 | remote_ip = self.ids.ip_id.text 100 | remote_port = int(self.ids.port_id.text) 101 | remote_cond = True 102 | 103 | theapp.mainscreen.ids.head_id.text = 'chat is opened with: ' + self.ids.ip_id.text + ' at port: ' + self.ids.port_id.text 104 | theapp.screenm.current = 'mainscreen' 105 | Clock.schedule_interval(theapp.mainscreen.update_recieved, 0.5) 106 | 107 | class mainscreen(Widget): 108 | def __init__(self, **kwargs): 109 | super().__init__(**kwargs) 110 | 111 | def send_msg(self): 112 | global remote_msg 113 | self.ids.chat_text_id.text = self.ids.chat_text_id.text + '\n' + theapp.welcomescreen.ids.user_id.text +' : ' + self.ids.msg_id.text 114 | remote_msg = theapp.welcomescreen.ids.user_id.text + ': ' + self.ids.msg_id.text 115 | 116 | 117 | def update_recieved(self, *args): 118 | global listen_msg 119 | if listen_msg != '': 120 | self.ids.chat_text_id.text = self.ids.chat_text_id.text + '\n' + '[color=#3477eb]' + listen_msg + '[/color]' 121 | listen_msg = '' 122 | 123 | 124 | class theapp(App): 125 | def build(self): 126 | self.screenm = ScreenManager(transition=FadeTransition()) 127 | self.welcomescreen = welcomescreen() 128 | screen = Screen(name = "welcomescreen") 129 | screen.add_widget(self.welcomescreen) 130 | self.screenm.add_widget(screen) 131 | 132 | self.mainscreen = mainscreen() 133 | screen = Screen(name = "mainscreen") 134 | screen.add_widget(self.mainscreen) 135 | self.screenm.add_widget(screen) 136 | 137 | return self.screenm 138 | 139 | if __name__ == "__main__": 140 | theapp = theapp() 141 | thread_1.start() 142 | thread_2.start() 143 | threading.Thread(target = theapp.run()) 144 | remote_cond = False 145 | listen_cond = False -------------------------------------------------------------------------------- /git_mapview/fifth_part/main.py: -------------------------------------------------------------------------------- 1 | 2 | import kivy 3 | from kivy.uix.gridlayout import GridLayout 4 | from kivy.app import App 5 | from kivy.uix.label import Label 6 | from kivy.uix.button import Button 7 | from kivy.uix.screenmanager import ScreenManager, Screen 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.widget import Widget 10 | from kivy.clock import Clock 11 | from kivy.uix.image import Image 12 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 13 | from kivy.core.window import Window 14 | from kivy.config import Config 15 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 16 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 17 | from functools import partial 18 | from kivy.graphics.texture import Texture 19 | from kivy.uix.image import Image 20 | from kivy.uix.textinput import TextInput 21 | from kivy_garden.mapview import MapView, MapMarkerPopup, MapMarker, MapSource 22 | import requests 23 | import re 24 | 25 | class fscreen(Widget): 26 | my_avat = StringProperty() 27 | def __init__(self, **kwargs): 28 | super().__init__(**kwargs) 29 | 30 | self.placed = False 31 | self.exists = False 32 | self.ids.main_map.zoom = 15 33 | self.ids.main_map.center_on(self.ids.main_map_me.lat, self.ids.main_map_me.lon) 34 | self.my_avat = 'avatar.png' 35 | 36 | def press(self): 37 | print(str(self.ids.main_map_me.lat) + ' | ' + str(self.ids.main_map_me.lon)) 38 | 39 | def place_pin(self): 40 | self.placed = True 41 | 42 | def remove_pin(self): 43 | if self.exists == True: 44 | self.ids.main_map.remove_widget(self.dist) 45 | self.placed = False 46 | self.exists = False 47 | 48 | def on_touch_up(self, touch): 49 | if touch.y > self.height*0.05: 50 | if self.placed == True and self.exists == False: 51 | self.dist = MapMarkerPopup(lat=self.ids.main_map.get_latlon_at(touch.x, touch.y)[0], lon=self.ids.main_map.get_latlon_at(touch.x, touch.y)[1], source='dist.png') 52 | 53 | self.btn = Button(text='print loc', on_press=self.press_dist) 54 | self.dist.add_widget(self.btn) 55 | self.ids.main_map.add_widget(self.dist) 56 | print(self.ids.main_map.get_latlon_at(touch.x, touch.y)) 57 | self.exists = True 58 | 59 | def press_dist(self, instance): 60 | print(self.dist.lat) 61 | print(self.dist.lon) 62 | 63 | self.start_lon = self.ids.main_map_me.lon 64 | self.start_lat = self.ids.main_map_me.lat 65 | 66 | self.end_lon = self.dist.lon 67 | self.end_lat = self.dist.lat 68 | self.body = {"coordinates":[[self.start_lon,self.start_lat],[self.end_lon,self.end_lat]]} 69 | self.headers = { 70 | 'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8', 71 | 'Authorization': '5b3ce3597851110001cf6248e32f3f787ba541e8b3d916f4681b9340', 72 | 'Content-Type': 'application/json; charset=utf-8'} 73 | self.call = requests.post('https://api.openrouteservice.org/v2/directions/driving-car/gpx', json=self.body, headers=self.headers) 74 | print(self.call.text) 75 | self.string_res = self.call.text 76 | 77 | print(self.string_res) 78 | 79 | self.tag = 'rtept' 80 | self.reg_str = '(.*?)' + '>' 81 | self.res = re.findall(self.reg_str, self.string_res) 82 | print(self.res) 83 | print('_____________________________________') 84 | self.string1 = str(self.res) 85 | self.tag1 = '"' 86 | self.reg_str1 = '"' + '(.*?)' + '"' 87 | self.res1 = re.findall(self.reg_str1, self.string1) 88 | print(self.res1) 89 | 90 | for i in range(0, len(self.res1)-1, 2): 91 | print('lat= ' + self.res1[i]) 92 | print('lon= ' + self.res1[i+1]) 93 | 94 | self.points_lat = self.res1[i] 95 | self.points_lon = self.res1[i+1] 96 | 97 | self.points_pop = MapMarkerPopup(lat=self.points_lat, lon=self.points_lon, source='waypoints.png') 98 | self.ids.main_map.add_widget(self.points_pop) 99 | 100 | 101 | class theapp(App): 102 | def build(self): 103 | 104 | self.screenm = ScreenManager() 105 | 106 | self.fscreen = fscreen() 107 | screen = Screen(name = "first screen") 108 | screen.add_widget(self.fscreen) 109 | self.screenm.add_widget(screen) 110 | 111 | 112 | return self.screenm 113 | 114 | if __name__ == "__main__": 115 | theapp = theapp() 116 | theapp.run() -------------------------------------------------------------------------------- /git_mapview/sixth_part/main.py: -------------------------------------------------------------------------------- 1 | 2 | import kivy 3 | from kivy.uix.gridlayout import GridLayout 4 | from kivy.app import App 5 | from kivy.uix.label import Label 6 | from kivy.uix.button import Button 7 | from kivy.uix.screenmanager import ScreenManager, Screen 8 | from kivy.uix.boxlayout import BoxLayout 9 | from kivy.uix.widget import Widget 10 | from kivy.clock import Clock 11 | from kivy.uix.image import Image 12 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 13 | from kivy.core.window import Window 14 | from kivy.config import Config 15 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 16 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 17 | from functools import partial 18 | from kivy.graphics.texture import Texture 19 | from kivy.uix.image import Image 20 | from kivy.uix.textinput import TextInput 21 | from kivy_garden.mapview import MapView, MapMarkerPopup, MapMarker, MapSource 22 | import requests 23 | import re 24 | 25 | class fscreen(Widget): 26 | my_avat = StringProperty() 27 | def __init__(self, **kwargs): 28 | super().__init__(**kwargs) 29 | self.list_of_lines = [] 30 | self.route_points = [] 31 | self.placed = False 32 | self.exists = False 33 | self.ids.main_map.zoom = 15 34 | self.ids.main_map.center_on(self.ids.main_map_me.lat, self.ids.main_map_me.lon) 35 | self.my_avat = 'avatar.png' 36 | 37 | 38 | 39 | def press(self): 40 | print(str(self.ids.main_map_me.lat) + ' | ' + str(self.ids.main_map_me.lon)) 41 | 42 | def place_pin(self): 43 | self.placed = True 44 | 45 | def remove_pin(self): 46 | if self.exists == True: 47 | self.ids.main_map.remove_widget(self.dist) 48 | self.placed = False 49 | self.exists = False 50 | 51 | def on_touch_up(self, touch): 52 | if touch.y > self.height*0.05: 53 | if self.placed == True and self.exists == False: 54 | self.dist = MapMarkerPopup(lat=self.ids.main_map.get_latlon_at(touch.x, touch.y)[0], lon=self.ids.main_map.get_latlon_at(touch.x, touch.y)[1], source='dist.png') 55 | 56 | self.btn = Button(text='print loc', on_press=self.press_dist) 57 | self.dist.add_widget(self.btn) 58 | self.ids.main_map.add_widget(self.dist) 59 | print(self.ids.main_map.get_latlon_at(touch.x, touch.y)) 60 | self.exists = True 61 | 62 | def press_dist(self, instance): 63 | print(self.dist.lat) 64 | print(self.dist.lon) 65 | 66 | self.start_lon = self.ids.main_map_me.lon 67 | self.start_lat = self.ids.main_map_me.lat 68 | 69 | self.end_lon = self.dist.lon 70 | self.end_lat = self.dist.lat 71 | self.body = {"coordinates":[[self.start_lon,self.start_lat],[self.end_lon,self.end_lat]]} 72 | self.headers = { 73 | 'Accept': 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8', 74 | 'Authorization': '5b3ce3597851110001cf6248e32f3f787ba541e8b3d916f4681b9340', 75 | 'Content-Type': 'application/json; charset=utf-8'} 76 | self.call = requests.post('https://api.openrouteservice.org/v2/directions/driving-car/gpx', json=self.body, headers=self.headers) 77 | print(self.call.text) 78 | self.string_res = self.call.text 79 | 80 | print(self.string_res) 81 | 82 | self.tag = 'rtept' 83 | self.reg_str = '(.*?)' + '>' 84 | self.res = re.findall(self.reg_str, self.string_res) 85 | print(self.res) 86 | print('_____________________________________') 87 | self.string1 = str(self.res) 88 | self.tag1 = '"' 89 | self.reg_str1 = '"' + '(.*?)' + '"' 90 | self.res1 = re.findall(self.reg_str1, self.string1) 91 | print(self.res1) 92 | 93 | for i in range(0, len(self.res1)-1, 2): 94 | print('lat= ' + self.res1[i]) 95 | print('lon= ' + self.res1[i+1]) 96 | 97 | self.points_lat = self.res1[i] 98 | self.points_lon = self.res1[i+1] 99 | 100 | self.points_pop = MapMarkerPopup(lat=self.points_lat, lon=self.points_lon, source='waypoints.png') 101 | self.route_points.append(self.points_pop) 102 | 103 | self.ids.main_map.add_widget(self.points_pop) 104 | 105 | with self.canvas: 106 | Color(0.5, 0, 0 ,1) 107 | for j in range(0, len(self.route_points)-1, 1): 108 | self.lines = Line(points=(self.route_points[j].pos[0],self.route_points[j].pos[1], self.route_points[j+1].pos[0],self.route_points[j+1].pos[1] ), width=4) 109 | self.list_of_lines.append(self.lines) 110 | 111 | Clock.schedule_interval(self.update_route_lines, 1/50) 112 | def update_route_lines(self, *args): 113 | for j in range(1, len(self.route_points), 1): 114 | self.list_of_lines[j-1].points = [self.route_points[j-1].pos[0],self.route_points[j-1].pos[1], self.route_points[j].pos[0], self.route_points[j].pos[1]] 115 | 116 | class theapp(App): 117 | def build(self): 118 | 119 | self.screenm = ScreenManager() 120 | 121 | self.fscreen = fscreen() 122 | screen = Screen(name = "first screen") 123 | screen.add_widget(self.fscreen) 124 | self.screenm.add_widget(screen) 125 | 126 | 127 | return self.screenm 128 | 129 | if __name__ == "__main__": 130 | theapp = theapp() 131 | theapp.run() -------------------------------------------------------------------------------- /git.kivy_date/main.py: -------------------------------------------------------------------------------- 1 | import kivy 2 | from kivy.uix.gridlayout import GridLayout 3 | from kivy.app import App 4 | from kivy.uix.label import Label 5 | from kivy.uix.button import Button 6 | from kivy.uix.widget import Widget 7 | from kivy.clock import Clock 8 | from kivy.uix.image import Image 9 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 10 | from kivy.core.window import Window 11 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty, ListProperty 12 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 13 | from kivy.graphics.texture import Texture 14 | from kivy.uix.image import Image 15 | from kivy.lang import Builder 16 | 17 | from supperwidget.supperbutton import SupperButton 18 | Builder.load_file("supperwidget/supperbutton.kv") 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | class datescreen(Widget): 27 | 28 | def __init__(self,**kwargs): 29 | super().__init__(**kwargs) 30 | self.days_list = [] 31 | self.day_selected = 1 32 | self.current_month = 'January' 33 | self.current_year = 2024 34 | 35 | 36 | def confirm_date(self): 37 | pass 38 | 39 | def draw_day_buttons(self): 40 | for i in range(1, 32): 41 | btn = SupperButton() 42 | btn.text = str(i) 43 | btn.gr_left = '#ffffff' 44 | btn.gr_middle = '#cbcbcb' 45 | btn.gr_right = '#ffffff' 46 | btn.font_name = 'resources/fonts/1.ttf' 47 | btn.border_width = 1 48 | btn.border_color = [0, 0, 0, 1] 49 | btn.bind(on_press=self.day_select) 50 | self.ids.grid_days.add_widget(btn) 51 | self.days_list.append(btn) 52 | 53 | self.days_list[0].gr_left = "#474747" 54 | self.days_list[0].gr_right = "#949191" 55 | 56 | def on_size(self, *args): # this is just to initiate after the size is good 57 | if self.width > 100: 58 | self.draw_day_buttons() 59 | 60 | def day_select(self, instance): 61 | if self.day_selected is not None: 62 | self.days_list[int(self.day_selected) - 1].gr_left = '#ffffff' 63 | self.days_list[int(self.day_selected) - 1].gr_right = '#ffffff' 64 | 65 | instance.gr_left = "#474747" 66 | instance.gr_right = "#949191" 67 | 68 | self.day_selected = int(instance.text) 69 | self.ids.date_accept_lbl.text = str(self.day_selected) + ' ' + str(self.current_month) + ' ' + str(self.current_year) 70 | 71 | 72 | 73 | def move(self, target): 74 | if target == 'year_left': 75 | self.ids.input_year.text = str(self.year_prep() - 1) 76 | 77 | 78 | elif target == 'year_right': 79 | if self.year_prep() < 2024: 80 | self.ids.input_year.text = str(self.year_prep() + 1) 81 | 82 | 83 | elif target == 'month_left': 84 | self.ids.month_lbl.text = self.month_minus() 85 | elif target == 'month_right': 86 | self.ids.month_lbl.text = self.month_plus() 87 | 88 | self.current_year = self.ids.input_year.text 89 | self.current_month = self.ids.month_lbl.text 90 | 91 | c = False 92 | for items in self.days_list: 93 | if items.gr_left == '#474747': 94 | c = True 95 | 96 | if c == False: 97 | self.days_list[0].gr_left = "#474747" 98 | self.days_list[0].gr_right = "#949191" 99 | self.day_selected = '1' 100 | 101 | self.ids.date_accept_lbl.text = str(self.day_selected) + ' ' + str(self.current_month) + ' ' + str(self.current_year) 102 | 103 | def year_prep(self): 104 | try: 105 | year = int(self.ids.input_year.text) 106 | if 1950 <= year <= 2024: 107 | return year 108 | except ValueError: 109 | pass 110 | return 2024 111 | 112 | def month_minus(self): 113 | months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] 114 | months_30 = ['April', 'June', 'September', 'November'] 115 | current_index = months.index(self.ids.month_lbl.text) 116 | 117 | 118 | if current_index > 0: 119 | current_index -= 1 120 | else: 121 | current_index = len(months) - 1 122 | 123 | previous_month = months[current_index] 124 | self.update_days_for_month(previous_month) 125 | 126 | return previous_month 127 | 128 | def month_plus(self): 129 | months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] 130 | 131 | months_30 = ['April', 'June', 'September', 'November'] 132 | current_index = months.index(self.ids.month_lbl.text) 133 | if current_index < len(months) - 1: 134 | current_index += 1 135 | else: 136 | current_index = 0 137 | 138 | next_month = months[current_index] 139 | self.update_days_for_month(next_month) 140 | 141 | return next_month 142 | 143 | def update_days_for_month(self, month): 144 | months_30 = ['April', 'June', 'September', 'November'] 145 | if month == 'February': 146 | if self.is_leap_year(self.year_prep()): 147 | max_days = 29 148 | else: 149 | max_days = 28 150 | elif month in months_30: 151 | max_days = 30 152 | else: 153 | max_days = 31 154 | current_day_count = len(self.days_list) 155 | 156 | if current_day_count > max_days: 157 | for _ in range(current_day_count - max_days): 158 | btn = self.days_list.pop() 159 | self.ids.grid_days.remove_widget(btn) 160 | elif current_day_count < max_days: 161 | for i in range(current_day_count + 1, max_days + 1): 162 | btn = SupperButton() 163 | btn.text = str(i) 164 | btn.gr_left = '#ffffff' 165 | btn.gr_middle = '#cbcbcb' 166 | btn.gr_right = '#ffffff' 167 | btn.font_name = 'resources/fonts/1.ttf' 168 | btn.border_width = 1 169 | btn.border_color = [0, 0, 0, 1] 170 | btn.bind(on_press=self.day_select) 171 | self.ids.grid_days.add_widget(btn) 172 | self.days_list.append(btn) 173 | 174 | def is_leap_year(self, year): 175 | return (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) 176 | 177 | 178 | 179 | class theapp(App): 180 | def build(self): 181 | 182 | self.screenm = ScreenManager() #(transition=FadeTransition()) 183 | 184 | self.datescreen= datescreen() 185 | screen = Screen(name = "datescreen") 186 | screen.add_widget(self.datescreen) 187 | self.screenm.add_widget(screen) 188 | 189 | return self.screenm 190 | 191 | if __name__ == "__main__": 192 | theapp = theapp() 193 | theapp.run() -------------------------------------------------------------------------------- /loggin demo/the.kv: -------------------------------------------------------------------------------- 1 | #:import get_color_from_hex kivy.utils.get_color_from_hex 2 | #:import Gradient kivy_gradient.Gradient 3 | 4 | 5 | 6 | canvas.before: 7 | Color: 8 | rgba: 1, 1, 1, 1 9 | Rectangle: 10 | size: root.size 11 | pos: root.pos 12 | 13 | 14 | Image: 15 | id: l01 16 | source: 'resources/images/loading.png' 17 | size: 64, 64 18 | pos: root.width*1.5, root.height*0.8 19 | fit_mode: 'fill' 20 | allow_stretch: True 21 | canvas.before: 22 | PushMatrix 23 | Rotate: 24 | angle: root.l01_angle 25 | origin: self.center 26 | canvas.after: 27 | PopMatrix 28 | 29 | Button: 30 | id: lock 31 | size: root.size 32 | pos: root.width*1.1, 0 33 | background_color: 0, 0, 0, 0 34 | 35 | 36 | 37 | canvas.before: 38 | Color: 39 | rgba: 1, 1, 1, 1 40 | Rectangle: 41 | size: root.size 42 | pos: root.pos 43 | 44 | 45 | SupperLabel: 46 | text: 'This system is for authorized use only. Unauthorized access is prohibited and may be subject to criminal or civil penalties. Use of this system may be monitored and recorded. By continuing, you consent to such monitoring and agree to abide by all applicable policies.' 47 | color: 1, 0, 0, 1 48 | size: root.width*0.8, root.height*0.15 49 | pos: root.width*0.1, root.height*0.75 50 | font_size: root.height*0.017 51 | font_name: 'resources/fonts/Lexend-Bold.ttf' 52 | border_color: [0, 0, 0, 0] 53 | type_speed: 0.01 54 | 55 | 56 | GridLayout: 57 | cols: 1 58 | size: root.width*0.9, root.height*0.35 59 | pos: root.width*0.05, root.height*0.4 60 | spacing: root.height*0.025 61 | 62 | SupperTextinput: 63 | padding_y: [self.height / 2.0 - (self.line_height / 2.0) * len(self._lines), 0] 64 | id: log_mail 65 | icon_source: 'resources/images/mail.png' 66 | hint_text: 'Enter Your Email' 67 | multiline: False #### this is gradient color left 68 | gr_left: '#ffffff' #### this is gradient color left 69 | gr_middle: '#cbcbcb' 70 | gr_right: '#ffffff' 71 | font_name: 'resources/fonts/Lexend-ExtraLight.ttf' #### this is gradient color right 72 | font_size: root.height*0.02 73 | icon_offset: -25 #### how left is the icon 74 | underline_width: 1 #### the width of the underline 75 | line_h: 10 #### the height of the underline 76 | border_width: 1 77 | border_color: [0, 0, 0, 1] 78 | sz_x: log_mail.size[1] - 10 79 | sz_y: log_mail.size[1] - 10 80 | 81 | SupperTextinput: 82 | padding_y: [self.height / 2.0 - (self.line_height / 2.0) * len(self._lines), 0] 83 | id: log_pass 84 | icon_source: 'resources/images/pass.png' 85 | hint_text: 'Enter Your Password' 86 | multiline: False #### this is gradient color left 87 | gr_left: '#ffffff' #### this is gradient color left 88 | gr_middle: '#cbcbcb' 89 | gr_right: '#ffffff' 90 | font_name: 'resources/fonts/Lexend-ExtraLight.ttf' #### this is gradient color right 91 | font_size: root.height*0.02 92 | icon_offset: -25 #### how left is the icon 93 | underline_width: 1 #### the width of the underline 94 | line_h: 10 #### the height of the underline 95 | border_width: 1 96 | border_color: [0, 0, 0, 1] 97 | 98 | sz_x: log_pass.size[1] - 10 99 | sz_y: log_pass.size[1] - 10 100 | 101 | GridLayout: 102 | cols: 3 103 | halign: "center" 104 | valign: "middle" 105 | 106 | CheckBox: 107 | id: remember_me 108 | background_checkbox_normal:'resources/images/dis.png' 109 | background_checkbox_down: 'resources/images/en.png' 110 | size_hint_x: 0.1 111 | 112 | 113 | Label: 114 | font_name: 'resources/fonts/Lexend-Bold.ttf' 115 | text: 'Remember Me' 116 | color: 0, 0, 0, 1 117 | halign: "left" 118 | valign: "middle" 119 | text_size: self.size 120 | font_size: root.height*0.013 121 | size_hint_x: 0.4 122 | 123 | Label: 124 | font_name: 'resources/fonts/Lexend-Bold.ttf' 125 | text: '[ref=Availability]Forgot Password[/ref]' 126 | 127 | color: 1, 0, 0, 0.7 128 | halign: "right" 129 | valign: "middle" 130 | markup: True 131 | text_size: self.size 132 | font_size: root.height*0.013 133 | on_ref_press: root.forgot_pass() 134 | size_hint_x: 0.5 135 | 136 | SupperButton: 137 | text: 'Login' 138 | gr_left: '#ffffff' #### this is gradient color left 139 | gr_middle: '#cbcbcb' 140 | gr_right: '#ffffff' 141 | font_name: 'resources/fonts/Lexend-Bold.ttf' 142 | font_size: root.height*0.02 143 | border_width: 1 144 | border_color: [0, 0, 0, 1] 145 | on_press: root.login("input") 146 | 147 | SupperLabel: 148 | id: login_error_lbl 149 | color: 1, 0, 0, 1 150 | font_size: root.height*0.017 151 | font_name: 'resources/fonts/Lexend-Bold.ttf' 152 | border_color: [0, 0, 0, 0] 153 | type_speed: 0.01 154 | 155 | Image: 156 | id: l01 157 | source: 'resources/images/loading.png' 158 | size: 64, 64 159 | pos: root.width*1.5, root.height*0.8 160 | fit_mode: 'fill' 161 | allow_stretch: True 162 | canvas.before: 163 | PushMatrix 164 | Rotate: 165 | angle: root.l01_angle 166 | origin: self.center 167 | canvas.after: 168 | PopMatrix 169 | 170 | Button: 171 | id: lock 172 | size: root.size 173 | pos: root.width*1.1, 0 174 | background_color: 0, 0, 0, 0 175 | 176 | 177 | canvas.before: 178 | Color: 179 | rgba: 1, 1, 1, 1 180 | Rectangle: 181 | size: root.size 182 | pos: 0, 0 183 | 184 | 185 | SupperLabel: 186 | text: 'Welcome buddy i just got logged in' 187 | color: 0, 0, 0.8, 1 188 | size: root.width*0.8, root.height*0.15 189 | pos: root.width*0.1, root.height*0.75 190 | font_size: root.height*0.017 191 | font_name: 'resources/fonts/Lexend-Bold.ttf' 192 | border_color: [0, 0, 0, 0] 193 | type_speed: 0.01 194 | 195 | 196 | 197 | SupperButton: 198 | text: 'Logout' 199 | gr_left: '#ffffff' #### this is gradient color left 200 | gr_middle: '#cbcbcb' 201 | gr_right: '#ffffff' 202 | size: root.width*0.2, root.height*0.05 203 | pos: root.width*0.4, root.height*0.5 204 | font_name: 'resources/fonts/Lexend-Bold.ttf' 205 | font_size: root.height*0.02 206 | border_width: 1 207 | border_color: [0, 0, 0, 1] 208 | on_press: root.logout() 209 | -------------------------------------------------------------------------------- /git_kivy_illusion/main.py: -------------------------------------------------------------------------------- 1 | import kivy 2 | from kivy.uix.gridlayout import GridLayout 3 | from kivy.app import App 4 | from kivy.uix.label import Label 5 | from kivy.uix.button import Button 6 | from kivy.uix.screenmanager import ScreenManager, Screen 7 | from kivy.uix.boxlayout import BoxLayout 8 | from kivy.uix.widget import Widget 9 | from kivy.clock import Clock 10 | from kivy.uix.image import Image 11 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 12 | from kivy.core.window import Window 13 | from kivy.config import Config 14 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 15 | from functools import partial 16 | from kivy.graphics.texture import Texture 17 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 18 | from kivy.uix.image import Image 19 | from kivy.properties import StringProperty, ObjectProperty, NumericProperty, ReferenceListProperty 20 | 21 | import time 22 | import math 23 | import numpy as np 24 | import random 25 | 26 | class fscreen(Widget): 27 | 28 | def __init__(self, **kwargs): 29 | super().__init__(**kwargs) 30 | self.init = False 31 | 32 | self.tch = '' 33 | self.d = 0 34 | self.p = 0 35 | 36 | self.xpt1 = 0 37 | self.ypt1 = 0 38 | self.ypt3 = 0 39 | self.xpt3 = 0 40 | self.ypt2 = 0 41 | self.xpt2 = 0 42 | self.cnt = 0 43 | 44 | self.obj_bzlist = [] 45 | 46 | self.list_bz_minus = [] 47 | self.list_bz_plus = [] 48 | self.string_par_minus = [] 49 | self.string_par_plus = [] 50 | self.curvingy= 0.7 51 | self.curvingx= 0.6 52 | 53 | self.converge_end = self.y*0.5 54 | self.converge_y = self.y*0.5 ##### bezier initial curving 55 | self.converge_x = self.y*0.5 56 | self.converge_endx = self.x*0.5 57 | self.b =self.x*0.35 58 | self.a = self.b #### Eclipse formula 59 | self.k =self.y*0.5 60 | self.h = self.x*0.5 61 | 62 | 63 | self.bz1 = Line(bezier=(0, 0, 0, 0, 0, 0),width = 0) 64 | self.bz2 = Line(bezier=(0, 0, 0, 0, 0, 0),width = 0) 65 | 66 | 67 | Clock.schedule_interval(self.converge_update, 1/60) 68 | Clock.schedule_interval(self.convergex_update, 1/60) 69 | Clock.schedule_interval(self.curv, 2) 70 | 71 | 72 | 73 | 74 | 75 | def on_touch_down(self, touch): 76 | if self.init == False: 77 | self.x = self.width 78 | self.y = self.height 79 | ########## dist between point and point 2 in object 80 | 81 | self.x_obj_end = self.x*0.5 82 | self.y_obj_end = self.y*0.23 #####initial object 83 | self.converge_obj_x = self.x*0.5 84 | self.converge_obj_y = self.y*0.23 85 | 86 | ######################## 87 | self.converge_end = self.y*0.5 88 | self.converge_y = self.y*0.5 ##### bezier initial curving 89 | self.converge_x = self.y*0.5 90 | self.converge_endx = self.x*0.5 91 | 92 | ################ 93 | self.b = self.x*0.35 94 | self.a = self.y*0.4 #### Eclipse formula 95 | self.k =self.y*0.5 96 | self.h = self.x*0.5 97 | ################ 98 | 99 | 100 | for self.i in np.arange(self.y*0.1, self.y*0.91, self.y*0.025): 101 | print(str(self.i)) 102 | self.x_bez_start_minus = (-(self.b*math.sqrt(-(self.i*self.i) + (2*self.k*self.i)-(self.k*self.k)+(self.a*self.a)))/self.a)+self.h 103 | self.x_bez_start_plus = ((self.b*math.sqrt(-(self.i*self.i) + (2*self.k*self.i)-(self.k*self.k)+(self.a*self.a)))/self.a)+self.h 104 | 105 | with self.canvas: 106 | Color(random.uniform(0, 1), random.uniform(0,1), random.uniform(0, 1)) 107 | self.linebz_minus = Line(bezier=(self.x_bez_start_minus, self.i, self.x*0.5, self.converge_y , self.x/2, self.converge_end),width = 1) 108 | self.linebz_plus = Line(bezier=(self.x_bez_start_plus, self.i, self.x*0.5, self.converge_y , self.x/2, self.converge_end),width = 1) 109 | 110 | self.list_bz_minus.append(self.linebz_minus) 111 | self.string_par_minus.append(str(self.x_bez_start_minus)+','+str(self.i)+','+str(self.x*0.5)+','+str(self.converge_y)+','+str(self.x/2)+','+str(self.converge_end)) 112 | 113 | self.list_bz_plus.append(self.linebz_plus) 114 | self.string_par_plus.append(str(self.x_bez_start_plus)+','+str(self.i)+','+str(self.x*0.5)+','+str(self.converge_y)+','+str(self.x/2)+','+str(self.converge_end)) 115 | self.cnt = self.cnt+1 116 | 117 | 118 | 119 | 120 | print('this is ' +str(self.d)) 121 | self.init = True 122 | 123 | 124 | def convergex_update(self, *args): 125 | if self.converge_endx < self.x*self.curvingx: 126 | 127 | self.converge_endx = self.converge_endx + self.x*0.008 128 | self.x_obj_end = self.converge_endx 129 | 130 | #self.object_bz1 = Line(bezier=(self.x_object_1, self.y_object_2, self.converge_obj_x, self.converge_obj_y , self.x_obj_end, self.y_obj_end ),width = 1) 131 | 132 | #self.object_bz2 = Line(bezier=(self.x_object_2, self.y_object_2, self.converge_obj_x, self.converge_obj_y , self.x_obj_end, self.y_obj_end ),width = 1) 133 | 134 | 135 | for self.ind in range(0, self.cnt, 1): 136 | 137 | self.list_bz_plus[self.ind].bezier = [float(self.string_par_plus[self.ind].split(',')[0]),float(self.string_par_plus[self.ind].split(',')[1]),float(self.string_par_plus[self.ind].split(',')[2]),float(self.string_par_plus[self.ind].split(',')[3]), self.converge_endx,self.converge_end] 138 | 139 | #self.object_bz1 = Line(bezier=(self.x_object_1, self.y_object_2, self.converge_obj_x, self.converge_obj_y , self.x_obj_end, self.y_obj_end ),width = 1) 140 | #self.object_bz2 = Line(bezier=(self.x_object_2, self.y_object_2, self.converge_obj_x, self.converge_obj_y , self.x_obj_end, self.y_obj_end ),width = 1) 141 | 142 | self.list_bz_minus[self.ind].bezier = [float(self.string_par_minus[self.ind].split(',')[0]),float(self.string_par_minus[self.ind].split(',')[1]),float(self.string_par_minus[self.ind].split(',')[2]),float(self.string_par_minus[self.ind].split(',')[3]), self.converge_endx,self.converge_end] 143 | 144 | if self.converge_endx >= self.x*self.curvingx: 145 | 146 | self.converge_endx = self.converge_endx - self.x*0.008 147 | self.x_obj_end = self.converge_endx 148 | 149 | for self.ind in range(0, self.cnt, 1): 150 | self.list_bz_plus[self.ind].bezier = [float(self.string_par_plus[self.ind].split(',')[0]),float(self.string_par_plus[self.ind].split(',')[1]),float(self.string_par_plus[self.ind].split(',')[2]),float(self.string_par_plus[self.ind].split(',')[3]), self.converge_endx,self.converge_end] 151 | self.list_bz_minus[self.ind].bezier = [float(self.string_par_minus[self.ind].split(',')[0]),float(self.string_par_minus[self.ind].split(',')[1]),float(self.string_par_minus[self.ind].split(',')[2]),float(self.string_par_minus[self.ind].split(',')[3]), self.converge_endx,self.converge_end] 152 | 153 | 154 | 155 | def converge_update(self, *args): 156 | 157 | if self.converge_end < self.y*self.curvingy: 158 | self.converge_end = self.converge_end + self.y*0.008 159 | self.y_obj_end = self.converge_end 160 | 161 | if self.converge_end >= self.y*self.curvingy: 162 | self.converge_end = self.converge_end - self.y*0.008 163 | self.y_obj_end = self.converge_end 164 | 165 | def curv(self, *args): 166 | if self.curvingx > 0.5: 167 | self.curvingx = random.uniform(-0.1,-0.2) 168 | elif self.curvingx < 0.5: 169 | self.curvingx = random.uniform(1.1, 1.2) 170 | 171 | if self.curvingy > 0.5: 172 | self.curvingy = random.uniform(-0.1, -0.2) 173 | elif self.curvingy < 0.5: 174 | self.curvingy = random.uniform(1.2, 1.3) 175 | 176 | 177 | 178 | 179 | 180 | def generate(self, *args): 181 | pass 182 | 183 | 184 | 185 | def move_generated(self, *args): 186 | pass 187 | 188 | 189 | 190 | class secscreen(Widget): 191 | def __init__(self, **kwargs): 192 | super().__init__(**kwargs) 193 | 194 | 195 | 196 | 197 | 198 | 199 | class thscreen(Widget): 200 | 201 | def __init__(self, **kwargs): 202 | super().__init__(**kwargs) 203 | pass 204 | 205 | 206 | class theapp(App): 207 | def build(self): 208 | self.screenm = ScreenManager(transition=FadeTransition()) 209 | 210 | self.fscreen = fscreen() 211 | screen = Screen(name = "first screen") 212 | screen.add_widget(self.fscreen) 213 | self.screenm.add_widget(screen) 214 | 215 | self.secscreen = secscreen() 216 | screen = Screen(name = "secondscreen") 217 | screen.add_widget(self.secscreen) 218 | self.screenm.add_widget(screen) 219 | 220 | self.thscreen = thscreen() 221 | screen = Screen(name = "thirdscreen") 222 | screen.add_widget(self.thscreen) 223 | self.screenm.add_widget(screen) 224 | 225 | return self.screenm 226 | 227 | 228 | if __name__ == "__main__": 229 | theapp = theapp() 230 | theapp.run() 231 | -------------------------------------------------------------------------------- /loggin demo/main.py: -------------------------------------------------------------------------------- 1 | from kivy.app import App 2 | from kivy.uix.widget import Widget 3 | from kivy.lang import Builder 4 | from kivy.uix.label import Label 5 | from kivy.uix.button import Button 6 | from kivy.clock import Clock 7 | from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition 8 | from kivy.properties import ( 9 | StringProperty, 10 | ObjectProperty, 11 | NumericProperty, 12 | ReferenceListProperty, 13 | ListProperty, 14 | ) 15 | from kivy.graphics import Rectangle, Color, Line, Bezier, Ellipse, Triangle 16 | from kivy.utils import platform 17 | from kivy.core.window import Window 18 | import threading 19 | import re 20 | import time 21 | import sqlite3 22 | 23 | from supperwidget.suppertextinput import SupperTextinput 24 | 25 | Builder.load_file("supperwidget/suppertextinput.kv") 26 | 27 | from supperwidget.supperbutton import SupperButton 28 | 29 | Builder.load_file("supperwidget/supperbutton.kv") 30 | 31 | from supperwidget.supperlabel import SupperLabel 32 | 33 | Builder.load_file("supperwidget/supperlabel.kv") 34 | 35 | 36 | Window.size = (608, 1080) ##### delete this if u package for mobile 37 | 38 | login_catch = "" 39 | 40 | 41 | ######################### Detached threads 42 | def try_login(ml, ps, mc): 43 | global login_catch 44 | print("called") 45 | time.sleep(3) 46 | 47 | login_catch = "Valid_log" 48 | # login_catch = "Whatever to simulate" 49 | # login_catch ...... 50 | 51 | ## login_catch = http 52 | ## login_catch = sockets 53 | ## depends on how u want to send and rcv 54 | 55 | 56 | ######################### Detached threads end 57 | 58 | 59 | class initialscreen(Widget): 60 | l01_angle = NumericProperty() 61 | 62 | def __init__(self, **kwargs): 63 | super().__init__(**kwargs) 64 | self.l01_angle = 0 65 | 66 | def on_size(self, *args): 67 | if self.width > 100: 68 | self.ids.l01.pos[0] = (self.width * 0.5) - 32 69 | Clock.schedule_interval(self.loading, 1 / 30) 70 | self.ids.lock.pos[0] = 0 71 | theapp.access_screen.login("Saved") 72 | 73 | def loading(self, *args): 74 | if self.l01_angle < 360: 75 | self.l01_angle += 10 76 | 77 | if self.l01_angle >= 360: 78 | self.l01_angle = 0 79 | 80 | def stop_loading(self): 81 | Clock.unschedule(self.loading) 82 | self.ids.lock.pos[0] = self.width * 1.1 83 | 84 | 85 | class access_screen(Widget): 86 | l01_angle = NumericProperty() 87 | 88 | def __init__(self, **kwargs): 89 | super().__init__(**kwargs) 90 | self.login_timeout = 0 91 | self.l01_angle = 0 92 | 93 | def loading(self, *args): 94 | if self.l01_angle < 360: 95 | self.l01_angle += 10 96 | 97 | if self.l01_angle >= 360: 98 | self.l01_angle = 0 99 | 100 | def stop_loading(self): 101 | Clock.unschedule(self.loading) 102 | self.ids.lock.pos[0] = self.width * 1.1 103 | 104 | def check_creds(self, ml, ps): 105 | if ml != None and ps != None: 106 | if re.match( 107 | r"""^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+ 108 | (?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*| 109 | "(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]| 110 | \\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@ 111 | (?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+ 112 | [a-zA-Z]{2,}|localhost)$""", 113 | ml, 114 | re.VERBOSE, 115 | ): 116 | if ( 117 | any(c.islower() for c in ps) 118 | and any(c.isupper() for c in ps) 119 | and any(c.isdigit() for c in ps) 120 | and re.search(r"[^\w]", ps) 121 | ): 122 | return True 123 | 124 | else: 125 | self.ids.login_error_lbl.text = "Password Format is Wrong" 126 | return False 127 | 128 | else: 129 | self.ids.login_error_lbl.text = "Email Format is Wrong" 130 | return False 131 | 132 | else: 133 | return False 134 | 135 | def login(self, with_what): 136 | if with_what == "input": 137 | Clock.schedule_interval(self.loading, 1 / 30) 138 | self.ids.lock.pos[0] = 0 139 | 140 | print("called with input") 141 | res = self.check_creds(self.ids.log_mail.text, self.ids.log_pass.text) 142 | if res == True: 143 | # use hashlib to hash password or all data 144 | self.call_thread( 145 | self.ids.log_mail.text, self.ids.log_pass.text, theapp.mac 146 | ) 147 | 148 | elif res == False: 149 | pass 150 | 151 | ############################################# 152 | elif with_what == "Saved": 153 | print("called with Saved") 154 | res = self.fetch_saved_creds() 155 | if res != None: 156 | print("diff than None") 157 | if res[0][3] == 1: # 1 for remember me 0 for not remembering 158 | # use hashlib to hash password or all data 159 | self.call_thread(res[0][0], res[0][2], res[0][1]) 160 | 161 | elif res[0][3] == 0: 162 | print("remember", res[0][3]) 163 | theapp.screenm.current = "access_screen" 164 | 165 | elif res == None: 166 | print("Equal to None") 167 | theapp.screenm.current = "access_screen" 168 | 169 | def call_thread(self, ps, ml, mc): 170 | self.ids.login_error_lbl.text = "" 171 | Clock.schedule_interval(self.wait_login, 0.2) 172 | self.login_timeout = 0 173 | attempt = threading.Thread( 174 | target=try_login, 175 | args=(ml, ps, theapp.mac), 176 | ) 177 | attempt.start() 178 | 179 | def wait_login(self, *args): 180 | global login_catch 181 | print(login_catch) 182 | if self.login_timeout < 75: ## 0.2 * 72 = 15 sec timeout 183 | if login_catch != "": 184 | if login_catch == "Account Does Not Exist": 185 | self.ids.login_error_lbl.text = login_catch 186 | Clock.unschedule(self.wait_login) 187 | theapp.initialscreen.stop_loading() 188 | self.stop_loading() 189 | 190 | elif login_catch == "Password Wrong": 191 | self.ids.login_error_lbl.text = login_catch 192 | Clock.unschedule(self.wait_login) 193 | theapp.initialscreen.stop_loading() 194 | self.stop_loading() ## this is repitive u 195 | ## type more to avoid this 196 | 197 | elif login_catch == "Valid_log": 198 | theapp.global_email = self.ids.log_mail.text 199 | theapp.global_pass = self.ids.log_pass.text 200 | self.ids.login_error_lbl.text = "" 201 | theapp.screenm.current = "main_screen" 202 | if self.ids.remember_me.active == True: 203 | self.insert_saved_cred( 204 | self.ids.log_mail.text, 205 | theapp.mac, 206 | self.ids.log_pass.text, 207 | 1, 208 | ) 209 | 210 | Clock.unschedule(self.wait_login) 211 | theapp.initialscreen.stop_loading() 212 | self.stop_loading() 213 | 214 | else: 215 | self.ids.login_error_lbl.text = "Something Went Wrong! Try Again" 216 | Clock.unschedule(self.wait_login) 217 | 218 | theapp.initialscreen.stop_loading() 219 | self.stop_loading() 220 | 221 | elif self.login_timeout >= 75: 222 | self.ids.login_error_lbl.text = "Time Out Please Try Again" 223 | Clock.unschedule(self.wait_login) 224 | theapp.initialscreen.stop_loading() 225 | self.stop_loading() 226 | 227 | def create_saved_creds_db(self): 228 | try: 229 | conn = sqlite3.connect("saved_creds.db") 230 | cursor = conn.cursor() 231 | 232 | cursor.execute( 233 | """ 234 | CREATE TABLE IF NOT EXISTS creds ( 235 | email TEXT, 236 | mac TEXT, 237 | password TEXT, 238 | remember INTEGER 239 | ) 240 | """ 241 | ) 242 | 243 | conn.commit() 244 | conn.close() 245 | 246 | except: 247 | pass 248 | 249 | def fetch_saved_creds(self): 250 | try: 251 | conn = sqlite3.connect("saved_creds.db") 252 | cursor = conn.cursor() 253 | 254 | cursor.execute("SELECT email, mac, password, remember FROM creds") 255 | rows = cursor.fetchall() 256 | 257 | conn.close() 258 | return rows 259 | except: 260 | return None 261 | 262 | def insert_saved_cred(self, email, mac, password, remember): 263 | self.create_saved_creds_db() 264 | 265 | conn = sqlite3.connect("saved_creds.db") 266 | cursor = conn.cursor() 267 | 268 | cursor.execute("DELETE FROM creds") 269 | 270 | cursor.execute( 271 | """ 272 | INSERT INTO creds (email, mac, password, remember) 273 | VALUES (?, ?, ?, ?) 274 | """, 275 | (email, mac, password, remember), 276 | ) 277 | 278 | conn.commit() 279 | conn.close() 280 | 281 | 282 | class main_screen(Widget): 283 | def __init__(self, **kwargs): 284 | super().__init__(**kwargs) 285 | 286 | def logout(self): 287 | ## u can make the same call with 288 | ## another outer thread to logout if u need to pass this to server 289 | theapp.screenm.current = "access_screen" 290 | theapp.access_screen.insert_saved_cred("", "", "", 0) ## to clear saved creds 291 | 292 | 293 | class theapp(App): 294 | def build(self): 295 | self.global_email = "" ## these variable could be hashed and stored locally 296 | self.global_pass = "" ## on the machine and could be use for further handshakes or token retrieving 297 | self.mac = None 298 | 299 | self.screenm = ScreenManager() 300 | 301 | self.initialscreen = initialscreen() 302 | screen = Screen(name="initialscreen screen") 303 | screen.add_widget(self.initialscreen) 304 | self.screenm.add_widget(screen) 305 | 306 | self.access_screen = access_screen() 307 | screen = Screen(name="access_screen") 308 | screen.add_widget(self.access_screen) 309 | self.screenm.add_widget(screen) 310 | 311 | self.main_screen = main_screen() 312 | screen = Screen(name="main_screen") 313 | screen.add_widget(self.main_screen) 314 | self.screenm.add_widget(screen) 315 | 316 | return self.screenm 317 | 318 | def on_start(self): 319 | self.get_mac() 320 | 321 | def get_mac(self): 322 | from plyer import uniqueid 323 | 324 | try: 325 | mac = uniqueid.id 326 | if mac: 327 | self.mac = mac # m getting this on start u could avoid this logic 328 | return mac 329 | except: 330 | ### the app shoud exit if u dont retrieve it also we not checking 331 | print("Couldn't Retrieve Mac Adress") 332 | 333 | 334 | if __name__ == "__main__": 335 | theapp = theapp() 336 | theapp.run() 337 | -------------------------------------------------------------------------------- /git.kivy_date/buildozer.spec: -------------------------------------------------------------------------------- 1 | [app] 2 | 3 | # (str) Title of your application 4 | title = My Application 5 | 6 | # (str) Package name 7 | package.name = myapp 8 | 9 | # (str) Package domain (needed for android/ios packaging) 10 | package.domain = org.test 11 | 12 | # (str) Source code where the main.py live 13 | source.dir = . 14 | 15 | # (list) Source files to include (let empty to include all the files) 16 | source.include_exts = py,png,jpg,kv,atlas,ttf 17 | 18 | # (list) List of inclusions using pattern matching 19 | #source.include_patterns = assets/*,images/*.png 20 | 21 | # (list) Source files to exclude (let empty to not exclude anything) 22 | #source.exclude_exts = spec 23 | 24 | # (list) List of directory to exclude (let empty to not exclude anything) 25 | #source.exclude_dirs = tests, bin, venv 26 | 27 | # (list) List of exclusions using pattern matching 28 | # Do not prefix with './' 29 | #source.exclude_patterns = license,images/*/*.jpg 30 | 31 | # (str) Application versioning (method 1) 32 | version = 0.1 33 | 34 | # (str) Application versioning (method 2) 35 | # version.regex = __version__ = ['"](.*)['"] 36 | # version.filename = %(source.dir)s/main.py 37 | 38 | # (list) Application requirements 39 | # comma separated e.g. requirements = sqlite3,kivy 40 | requirements = python3,kivy,kivygradient 41 | 42 | # (str) Custom source folders for requirements 43 | # Sets custom source for any requirements with recipes 44 | # requirements.source.kivy = ../../kivy 45 | 46 | # (str) Presplash of the application 47 | #presplash.filename = %(source.dir)s/data/presplash.png 48 | 49 | # (str) Icon of the application 50 | #icon.filename = %(source.dir)s/data/icon.png 51 | 52 | # (list) Supported orientations 53 | # Valid options are: landscape, portrait, portrait-reverse or landscape-reverse 54 | orientation = portrait 55 | 56 | # (list) List of service to declare 57 | #services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY 58 | 59 | # 60 | # OSX Specific 61 | # 62 | 63 | # 64 | # author = © Copyright Info 65 | 66 | # change the major version of python used by the app 67 | osx.python_version = 3 68 | 69 | # Kivy version to use 70 | osx.kivy_version = 1.9.1 71 | 72 | # 73 | # Android specific 74 | # 75 | 76 | # (bool) Indicate if the application should be fullscreen or not 77 | fullscreen = 0 78 | 79 | # (string) Presplash background color (for android toolchain) 80 | # Supported formats are: #RRGGBB #AARRGGBB or one of the following names: 81 | # red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, 82 | # darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, 83 | # olive, purple, silver, teal. 84 | #android.presplash_color = #FFFFFF 85 | 86 | # (string) Presplash animation using Lottie format. 87 | # see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/ 88 | # for general documentation. 89 | # Lottie files can be created using various tools, like Adobe After Effect or Synfig. 90 | #android.presplash_lottie = "path/to/lottie/file.json" 91 | 92 | # (str) Adaptive icon of the application (used if Android API level is 26+ at runtime) 93 | #icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png 94 | #icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png 95 | 96 | # (list) Permissions 97 | # (See https://python-for-android.readthedocs.io/en/latest/buildoptions/#build-options-1 for all the supported syntaxes and properties) 98 | #android.permissions = android.permission.INTERNET, (name=android.permission.WRITE_EXTERNAL_STORAGE;maxSdkVersion=18) 99 | 100 | # (list) features (adds uses-feature -tags to manifest) 101 | #android.features = android.hardware.usb.host 102 | 103 | # (int) Target Android API, should be as high as possible. 104 | #android.api = 31 105 | 106 | # (int) Minimum API your APK / AAB will support. 107 | #android.minapi = 21 108 | 109 | # (int) Android SDK version to use 110 | #android.sdk = 20 111 | 112 | # (str) Android NDK version to use 113 | #android.ndk = 23b 114 | 115 | # (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi. 116 | #android.ndk_api = 21 117 | 118 | # (bool) Use --private data storage (True) or --dir public storage (False) 119 | #android.private_storage = True 120 | 121 | # (str) Android NDK directory (if empty, it will be automatically downloaded.) 122 | #android.ndk_path = 123 | 124 | # (str) Android SDK directory (if empty, it will be automatically downloaded.) 125 | #android.sdk_path = 126 | 127 | # (str) ANT directory (if empty, it will be automatically downloaded.) 128 | #android.ant_path = 129 | 130 | # (bool) If True, then skip trying to update the Android sdk 131 | # This can be useful to avoid excess Internet downloads or save time 132 | # when an update is due and you just want to test/build your package 133 | # android.skip_update = False 134 | 135 | # (bool) If True, then automatically accept SDK license 136 | # agreements. This is intended for automation only. If set to False, 137 | # the default, you will be shown the license when first running 138 | # buildozer. 139 | # android.accept_sdk_license = False 140 | 141 | # (str) Android entry point, default is ok for Kivy-based app 142 | #android.entrypoint = org.kivy.android.PythonActivity 143 | 144 | # (str) Full name including package path of the Java class that implements Android Activity 145 | # use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity 146 | #android.activity_class_name = org.kivy.android.PythonActivity 147 | 148 | # (str) Extra xml to write directly inside the element of AndroidManifest.xml 149 | # use that parameter to provide a filename from where to load your custom XML code 150 | #android.extra_manifest_xml = ./src/android/extra_manifest.xml 151 | 152 | # (str) Extra xml to write directly inside the tag of AndroidManifest.xml 153 | # use that parameter to provide a filename from where to load your custom XML arguments: 154 | #android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml 155 | 156 | # (str) Full name including package path of the Java class that implements Python Service 157 | # use that parameter to set custom Java class which extends PythonService 158 | #android.service_class_name = org.kivy.android.PythonService 159 | 160 | # (str) Android app theme, default is ok for Kivy-based app 161 | # android.apptheme = "@android:style/Theme.NoTitleBar" 162 | 163 | # (list) Pattern to whitelist for the whole project 164 | #android.whitelist = 165 | 166 | # (str) Path to a custom whitelist file 167 | #android.whitelist_src = 168 | 169 | # (str) Path to a custom blacklist file 170 | #android.blacklist_src = 171 | 172 | # (list) List of Java .jar files to add to the libs so that pyjnius can access 173 | # their classes. Don't add jars that you do not need, since extra jars can slow 174 | # down the build process. Allows wildcards matching, for example: 175 | # OUYA-ODK/libs/*.jar 176 | #android.add_jars = foo.jar,bar.jar,path/to/more/*.jar 177 | 178 | # (list) List of Java files to add to the android project (can be java or a 179 | # directory containing the files) 180 | #android.add_src = 181 | 182 | # (list) Android AAR archives to add 183 | #android.add_aars = 184 | 185 | # (list) Put these files or directories in the apk assets directory. 186 | # Either form may be used, and assets need not be in 'source.include_exts'. 187 | # 1) android.add_assets = source_asset_relative_path 188 | # 2) android.add_assets = source_asset_path:destination_asset_relative_path 189 | #android.add_assets = 190 | 191 | # (list) Put these files or directories in the apk res directory. 192 | # The option may be used in three ways, the value may contain one or zero ':' 193 | # Some examples: 194 | # 1) A file to add to resources, legal resource names contain ['a-z','0-9','_'] 195 | # android.add_resources = my_icons/all-inclusive.png:drawable/all_inclusive.png 196 | # 2) A directory, here 'legal_icons' must contain resources of one kind 197 | # android.add_resources = legal_icons:drawable 198 | # 3) A directory, here 'legal_resources' must contain one or more directories, 199 | # each of a resource kind: drawable, xml, etc... 200 | # android.add_resources = legal_resources 201 | #android.add_resources = 202 | 203 | # (list) Gradle dependencies to add 204 | #android.gradle_dependencies = 205 | 206 | # (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies' 207 | # contains an 'androidx' package, or any package from Kotlin source. 208 | # android.enable_androidx requires android.api >= 28 209 | #android.enable_androidx = True 210 | 211 | # (list) add java compile options 212 | # this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option 213 | # see https://developer.android.com/studio/write/java8-support for further information 214 | # android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8" 215 | 216 | # (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies} 217 | # please enclose in double quotes 218 | # e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }" 219 | #android.add_gradle_repositories = 220 | 221 | # (list) packaging options to add 222 | # see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html 223 | # can be necessary to solve conflicts in gradle_dependencies 224 | # please enclose in double quotes 225 | # e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'" 226 | #android.add_packaging_options = 227 | 228 | # (list) Java classes to add as activities to the manifest. 229 | #android.add_activities = com.example.ExampleActivity 230 | 231 | # (str) OUYA Console category. Should be one of GAME or APP 232 | # If you leave this blank, OUYA support will not be enabled 233 | #android.ouya.category = GAME 234 | 235 | # (str) Filename of OUYA Console icon. It must be a 732x412 png image. 236 | #android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png 237 | 238 | # (str) XML file to include as an intent filters in tag 239 | #android.manifest.intent_filters = 240 | 241 | # (list) Copy these files to src/main/res/xml/ (used for example with intent-filters) 242 | #android.res_xml = PATH_TO_FILE, 243 | 244 | # (str) launchMode to set for the main activity 245 | #android.manifest.launch_mode = standard 246 | 247 | # (str) screenOrientation to set for the main activity. 248 | # Valid values can be found at https://developer.android.com/guide/topics/manifest/activity-element 249 | #android.manifest.orientation = fullSensor 250 | 251 | # (list) Android additional libraries to copy into libs/armeabi 252 | #android.add_libs_armeabi = libs/android/*.so 253 | #android.add_libs_armeabi_v7a = libs/android-v7/*.so 254 | #android.add_libs_arm64_v8a = libs/android-v8/*.so 255 | #android.add_libs_x86 = libs/android-x86/*.so 256 | #android.add_libs_mips = libs/android-mips/*.so 257 | 258 | # (bool) Indicate whether the screen should stay on 259 | # Don't forget to add the WAKE_LOCK permission if you set this to True 260 | #android.wakelock = False 261 | 262 | # (list) Android application meta-data to set (key=value format) 263 | #android.meta_data = 264 | 265 | # (list) Android library project to add (will be added in the 266 | # project.properties automatically.) 267 | #android.library_references = 268 | 269 | # (list) Android shared libraries which will be added to AndroidManifest.xml using tag 270 | #android.uses_library = 271 | 272 | # (str) Android logcat filters to use 273 | #android.logcat_filters = *:S python:D 274 | 275 | # (bool) Android logcat only display log for activity's pid 276 | #android.logcat_pid_only = False 277 | 278 | # (str) Android additional adb arguments 279 | #android.adb_args = -H host.docker.internal 280 | 281 | # (bool) Copy library instead of making a libpymodules.so 282 | #android.copy_libs = 1 283 | 284 | # (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 285 | # In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time. 286 | android.archs = arm64-v8a, armeabi-v7a 287 | 288 | # (int) overrides automatic versionCode computation (used in build.gradle) 289 | # this is not the same as app version and should only be edited if you know what you're doing 290 | # android.numeric_version = 1 291 | 292 | # (bool) enables Android auto backup feature (Android API >=23) 293 | android.allow_backup = True 294 | 295 | # (str) XML file for custom backup rules (see official auto backup documentation) 296 | # android.backup_rules = 297 | 298 | # (str) If you need to insert variables into your AndroidManifest.xml file, 299 | # you can do so with the manifestPlaceholders property. 300 | # This property takes a map of key-value pairs. (via a string) 301 | # Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"] 302 | # android.manifest_placeholders = [:] 303 | 304 | # (bool) Skip byte compile for .py files 305 | # android.no-byte-compile-python = False 306 | 307 | # (str) The format used to package the app for release mode (aab or apk or aar). 308 | # android.release_artifact = aab 309 | 310 | # (str) The format used to package the app for debug mode (apk or aar). 311 | # android.debug_artifact = apk 312 | 313 | # 314 | # Python for android (p4a) specific 315 | # 316 | 317 | # (str) python-for-android URL to use for checkout 318 | #p4a.url = 319 | 320 | # (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy) 321 | #p4a.fork = kivy 322 | 323 | # (str) python-for-android branch to use, defaults to master 324 | #p4a.branch = master 325 | 326 | # (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch 327 | #p4a.commit = HEAD 328 | 329 | # (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) 330 | #p4a.source_dir = 331 | 332 | # (str) The directory in which python-for-android should look for your own build recipes (if any) 333 | #p4a.local_recipes = 334 | 335 | # (str) Filename to the hook for p4a 336 | #p4a.hook = 337 | 338 | # (str) Bootstrap to use for android builds 339 | # p4a.bootstrap = sdl2 340 | 341 | # (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) 342 | #p4a.port = 343 | 344 | # Control passing the --use-setup-py vs --ignore-setup-py to p4a 345 | # "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not 346 | # Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py 347 | # NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate 348 | # setup.py if you're using Poetry, but you need to add "toml" to source.include_exts. 349 | #p4a.setup_py = false 350 | 351 | # (str) extra command line arguments to pass when invoking pythonforandroid.toolchain 352 | #p4a.extra_args = 353 | 354 | 355 | 356 | # 357 | # iOS specific 358 | # 359 | 360 | # (str) Path to a custom kivy-ios folder 361 | #ios.kivy_ios_dir = ../kivy-ios 362 | # Alternately, specify the URL and branch of a git checkout: 363 | ios.kivy_ios_url = https://github.com/kivy/kivy-ios 364 | ios.kivy_ios_branch = master 365 | 366 | # Another platform dependency: ios-deploy 367 | # Uncomment to use a custom checkout 368 | #ios.ios_deploy_dir = ../ios_deploy 369 | # Or specify URL and branch 370 | ios.ios_deploy_url = https://github.com/phonegap/ios-deploy 371 | ios.ios_deploy_branch = 1.10.0 372 | 373 | # (bool) Whether or not to sign the code 374 | ios.codesign.allowed = false 375 | 376 | # (str) Name of the certificate to use for signing the debug version 377 | # Get a list of available identities: buildozer ios list_identities 378 | #ios.codesign.debug = "iPhone Developer: ()" 379 | 380 | # (str) The development team to use for signing the debug version 381 | #ios.codesign.development_team.debug = 382 | 383 | # (str) Name of the certificate to use for signing the release version 384 | #ios.codesign.release = %(ios.codesign.debug)s 385 | 386 | # (str) The development team to use for signing the release version 387 | #ios.codesign.development_team.release = 388 | 389 | # (str) URL pointing to .ipa file to be installed 390 | # This option should be defined along with `display_image_url` and `full_size_image_url` options. 391 | #ios.manifest.app_url = 392 | 393 | # (str) URL pointing to an icon (57x57px) to be displayed during download 394 | # This option should be defined along with `app_url` and `full_size_image_url` options. 395 | #ios.manifest.display_image_url = 396 | 397 | # (str) URL pointing to a large icon (512x512px) to be used by iTunes 398 | # This option should be defined along with `app_url` and `display_image_url` options. 399 | #ios.manifest.full_size_image_url = 400 | 401 | 402 | [buildozer] 403 | 404 | # (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) 405 | log_level = 2 406 | 407 | # (int) Display warning if buildozer is run as root (0 = False, 1 = True) 408 | warn_on_root = 1 409 | 410 | # (str) Path to build artifact storage, absolute or relative to spec file 411 | # build_dir = ./.buildozer 412 | 413 | # (str) Path to build output (i.e. .apk, .aab, .ipa) storage 414 | # bin_dir = ./bin 415 | 416 | # ----------------------------------------------------------------------------- 417 | # List as sections 418 | # 419 | # You can define all the "list" as [section:key]. 420 | # Each line will be considered as a option to the list. 421 | # Let's take [app] / source.exclude_patterns. 422 | # Instead of doing: 423 | # 424 | #[app] 425 | #source.exclude_patterns = license,data/audio/*.wav,data/images/original/* 426 | # 427 | # This can be translated into: 428 | # 429 | #[app:source.exclude_patterns] 430 | #license 431 | #data/audio/*.wav 432 | #data/images/original/* 433 | # 434 | 435 | 436 | # ----------------------------------------------------------------------------- 437 | # Profiles 438 | # 439 | # You can extend section / key with a profile 440 | # For example, you want to deploy a demo version of your application without 441 | # HD content. You could first change the title to add "(demo)" in the name 442 | # and extend the excluded directories to remove the HD content. 443 | # 444 | #[app@demo] 445 | #title = My Application (demo) 446 | # 447 | #[app:source.exclude_patterns@demo] 448 | #images/hd/* 449 | # 450 | # Then, invoke the command line with the "demo" profile: 451 | # 452 | #buildozer --profile demo android debug 453 | --------------------------------------------------------------------------------