-
Notifications
You must be signed in to change notification settings - Fork 0
/
patient_signup.kv
178 lines (147 loc) · 6.08 KB
/
patient_signup.kv
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
174
175
176
177
#: import rgba kivy.utils.rgba
#: import Colors colors.Colors
<PatientSignup>:
name: 'patient signup'
############################## SIGNUP LABEL ##############################
GridLayout:
cols: 1
pos_hint: {"top": 1}
size_hint_y: 0.2
padding: 0, 25, 0, 0
Label:
text: "Patient Sign Up"
font_size: min(self.width*0.3, self.height) * 0.4
font_name: 'Roboto-Bold'
color: rgba(Colors.BLUE)
BoxLayout:
orientation: 'vertical'
pos_hint: {"top": .8}
size_hint_y: .3
############################## EMAIL ##############################
Label:
text: "Email:"
color: rgba(Colors.BLUE)
font_size: min(self.width, self.height) * 0.5
size_hint: (.1, .05)
pos_hint: {'x': 0.15}
TextInput:
id: patemail
size_hint: (.7, .05)
pos_hint: {'x': 0.15}
multiline: False
text: ""
font_size: min(self.width, self.height) * 0.5
background_color: rgba(*Colors.BLUE, 0)
foreground_color: rgba(Colors.ACCENT_BLUE)
canvas.after:
Color:
rgb: rgba(Colors.BLUE)
Line:
width: 2
rectangle: self.x, self.y, self.width, self.height
############################## PASSWORD ##############################
Label:
text: "Password:"
color: rgba(Colors.BLUE)
font_size: min(self.width, self.height) * 0.5
size_hint: (.1, .05)
pos_hint: {'x': 0.15}
TextInput:
id: patpass
size_hint: (.7, .05)
pos_hint: {'x': 0.15}
password: True
multiline: False
text: ""
font_size: min(self.width, self.height) * 0.5
background_color: rgba(*Colors.BLUE, 0)
foreground_color: rgba(Colors.ACCENT_BLUE)
canvas.after:
Color:
rgb: rgba(Colors.BLUE)
Line:
width: 2
rectangle: self.x, self.y, self.width, self.height
############################## CONFIRM PASSWORD ##############################
Label:
text: "Confirm Password:"
color: rgba(Colors.BLUE)
font_size: min(self.width, self.height) * 0.5
size_hint: (.1, .05)
pos_hint: {'x': 0.2}
TextInput:
id: patpassconfirm
size_hint: (.7, .05)
pos_hint: {'x': 0.15}
password: True
multiline: False
text: ""
font_size: min(self.width, self.height) * 0.5
background_color: rgba(*Colors.BLUE, 0)
foreground_color: rgba(Colors.ACCENT_BLUE)
canvas.after:
Color:
rgb: rgba(Colors.BLUE)
Line:
width: 2
rectangle: self.x, self.y, self.width, self.height
############################## EMS ID ##############################
Label:
text: "Driver License ID:"
color: rgba(Colors.BLUE)
font_size: min(self.width, self.height) * 0.5
size_hint: (.1, .05)
pos_hint: {'x': 0.2}
TextInput:
id: patDriverId
size_hint: (.7, .05)
pos_hint: {'x': 0.15}
password: True
multiline: False
text: ""
font_size: min(self.width, self.height) * 0.5
background_color: rgba(*Colors.BLUE, 0)
foreground_color: rgba(Colors.ACCENT_BLUE)
canvas.after:
Color:
rgb: rgba(Colors.BLUE)
Line:
width: 2
rectangle: self.x, self.y, self.width, self.height
############################## SIGNUP BUTTON ##############################
GridLayout:
cols: 1
size_hint_y: 0.4 # signup label (.2 size_hint_y) + boxlayout (.3 size_hint_y) + RESERVED GAP (.1 size_hint_y)
FloatLayout:
Button:
size_hint: (.4, .4)
pos_hint: {'center_x': 0.5, 'top': 1}
on_press:
root.manager.current = 'patient login' if root.valid_credentials(patemail, patpass, patpassconfirm, patDriverId) else 'patient signup'
color: rgba(Colors.BLUE)
background_normal: '' #https://stackoverflow.com/a/49100826/12514570
text: 'Signup'
font_size: min(self.width*0.3, self.height) * 0.5
background_color: rgba(Colors.LIGHT_BLUE)
# background_down: 'assets/orange_button_down.png'
canvas.before:
Color:
rgb: rgba(Colors.BLUE)
Line:
width: 3
rectangle: self.x, self.y, self.width, self.height
############################## Error Button ##############################
Label:
id: errorlbl
text: ''
color: rgba(255, 0, 0)
font_size: 15
pos_hint: {'center_y': 0.3}
############################## ALREADY HAVE ACCOUNT ##############################
Button:
text: 'Already have an account? Login'
font_size: min(self.width*0.25, self.height) * 0.15
color: rgba(Colors.BLUE)
background_normal: ''
background_color: rgba(*Colors.BLUE, 0)
on_press: root.manager.current = 'patient login'