-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·173 lines (107 loc) · 3.32 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import kivy
import smtplib
kivy.require('1.8.0')
from kivy.uix.label import Label
from kivy.app import App
from kivy.uix.button import Button
from kivy.uix.screenmanager import ScreenManager, Screen, NoTransition, SlideTransition
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.textinput import TextInput
from kivy.uix.anchorlayout import AnchorLayout
from kivy.config import Config
from email.mime.text import MIMEText
from kivy.uix.image import Image
from kivy.uix.popup import Popup
from kivy.graphics import *
sm = ScreenManager(transition=NoTransition())
class Slide(SlideTransition):
pass
class SignUpB(Image):
pass
class Logo(Image):
pass
class Password(Image):
pass
class Email(Image):
pass
class GeneralScreen (Screen):
pass
class Background(Image):
pass
class HomeScreen(Screen):
pass
class LogInScreen(Screen):
def get_info():
email = self.ids.EmailTI.text
password = self.ids.PasswordTI.text
return [email,password]
class SignUpScreen(Screen):
pass
class MapScreen(Screen):
pass
class MapI(Image):
pass
class ProfileScreen(Screen):
pass
class AidMeApp(App):
def build(self):
Config.set('kivy','keyboard_mode','')
Config.write()
print "window:"
self.width = Config.getint('graphics','width')
self.height= Config.getint('graphics','height')
self.general_screen = GeneralScreen(name="General")
self.home_screen = HomeScreen(name="Home")
self.login_screen = LogInScreen(name="LogIn")
self.singup_screen = SignUpScreen(name="SignUp")
self.profile_screen = ProfileScreen(name="Profile")
self.map_screen=MapScreen(name="Map")
sm.add_widget(self.map_screen)
sm.add_widget(self.home_screen)
sm.add_widget(self.login_screen)
sm.add_widget(self.singup_screen)
sm.add_widget(self.profile_screen)
sm.add_widget(self.general_screen)
sm.current = "LogIn"
return sm
def submit_clicked(self, id2):
if id2 == "ProfileB":
sm.transition = SlideTransition(direction="right")
sm.current = "Profile"
sm.transtion = NoTransition()
elif id2 == "InstructionsB":
sm.current = "General"
elif id2 == "LogInB":
sm.current = "Home"
elif id2 == "SignUpB":
sm.current = "SignUp"
elif id2 == "HomeB":
sm.transition = SlideTransition(direction="right")
sm.current = "Home"
sm.transtion = NoTransition()
elif id2 == "HomeB1":
sm.transition = SlideTransition(direction="left")
sm.current = "Home"
sm.transtion = NoTransition()
elif id2 == "LogOutB":
sm.transition = NoTransition()
sm.remove_widget(self.login_screen)
self.login_screen = LogInScreen(name="LogIn")
sm.add_widget(self.login_screen)
sm.current = "LogIn"
elif id2 == "MapB":
sm.transition = SlideTransition(direction="left")
sm.current = "Map"
sm.transtion = NoTransition()
elif id2 == "HelpB":
b = Button(text='Dismiss',size= (100,100), size_hint=(1,None))
# back.add_widget(Color(rgba=[1,1,1,1]))
# back.add_widget(Rectangle(pos = self.pos, size=self.size))
content = BoxLayout(orientation='vertical', size_hint=(1,1), size=(1,300))
popup = Popup( title="",content=content,size_hint=(0.5, 0.5),id="Popup")
content.add_widget(Label(text='Help is on the way!',font_size='20sp',bold=True))
content.add_widget(b)
b.bind(on_press=popup.dismiss)
popup.open()
if __name__=="__main__":
AidMeApp().run()