This repository has been archived by the owner on Mar 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui.kv
245 lines (224 loc) · 4.67 KB
/
gui.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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#:kivy 1.9.0
<TimeButton@Button>:
text_size: self.size
font_size: 20
size_hint: None, None
height: 30
width: 40
halign: 'center'
valign: 'middle'
background_color: 1.9,1.9,1.9,1
color: 0,0,0,1
<Settings>:
timeButton: timeButton
dropDown: dropDown
continueButton: continueButton
instantlyButton: instantlyButton
intervalButton: intervalButton
instantlyText: instantlyText
instantlyTextBg: instantlyTextBg
sidewaysButton: sidewaysButton
FloatLayout:
canvas.before:
Color:
rgba: 0.949, 0.961, 0.976, 1
Rectangle:
size: self.size
pos: self.pos
Label:
text_size: self.size
font_size: 20
size_hint: None, None
height: 80
width: 600
pos: 50, 300
halign: 'left'
valign: 'bottom'
color: 0,0,0,1
text: "Notification interval:"
TimeButton:
id: timeButton
pos: 240, 295
text: "5"
background_color: 1.5,1.5,1.5,1
DropDown:
id: dropDown
attach_to: timeButton
pos: 240, 205
TimeButton:
text: "5"
on_release: root.setTime(self.text)
TimeButton:
text: "10"
on_release: root.setTime(self.text)
TimeButton:
text: "15"
on_release: root.setTime(self.text)
FloatLayout:
id: instantlyTextBg
color: 0.949, 0.961, 0.976, 1
canvas.before:
Color:
rgba: instantlyTextBg.color
Rectangle:
size: self.size
pos: self.pos
Label:
id: instantlyText
text_size: self.size
font_size: 20
size_hint: None, None
height: 80
width: 600
pos: 50, 300
halign: 'left'
valign: 'bottom'
color: 0,0,0,1
text: "The program will take pictures every 10 seconds and notify you instantly if your posture is bad."
Label:
text_size: self.size
font_size: 20
size_hint: None, None
height: 80
width: 600
pos: 50, 400
halign: 'left'
valign: 'bottom'
color: 0,0,0,1
text: "Send me notifications..."
ToggleButton:
id: instantlyButton
size_hint: None, None
size: 100, 50
pos: 270, 390
text: "Instantly"
text_size: self.size
font_size: 18
valign: 'middle'
halign: 'center'
group: 'notificationSetting'
state: 'down'
ToggleButton:
id: intervalButton
size_hint: None, None
size: 100, 50
pos: 380, 390
text: "After a few minutes"
text_size: self.size
font_size: 18
valign: 'middle'
halign: 'center'
group: 'notificationSetting'
Label:
text_size: self.size
font_size: 20
size_hint: None, None
height: 50
width: 350
pos: 50, 190
halign: 'left'
valign: 'bottom'
color: 0,0,0,1
text: "Pay attention to sideways movement:"
ToggleButton:
id: sidewaysButton
pos: 400, 180
size_hint: None, None
height: 40
width: 60
text_size: self.size
halign: 'center'
valign: 'middle'
text: "Yes"
font_size: 20
group: 'sidewaysButtons'
state: 'down'
ToggleButton:
pos: 480, 180
size_hint: None, None
height: 40
width: 60
text_size: self.size
halign: 'center'
valign: 'middle'
text: "No"
font_size: 20
group: 'sidewaysButtons'
Button:
id: continueButton
font_size: 20
text_size: self.size
text: "Save settings"
color: 0,0,0,1
halign: 'center'
valign: 'middle'
background_color: 1.9,1.9,1.9,1
size_x: 100
size_y: 60
size_hint: None, None
size: self.size_x,self.size_y
pos: root.width / 2 - self.size[0] / 2, 40
<TakePhoto>:
image: img
button: button
FloatLayout:
Image:
id: img
source: "1.png"
allow_stretch: True
size: root.width,root.height
color: 0,0,0,1
Button:
id: button
font_size: 20
text_size: self.size
text: "Take comparison picture"
color: 1,1,1,1
disabled_color: 1,1,1,0.5
halign: 'center'
valign: 'middle'
background_color: 0.9,0.9,0.9,1
size_x: 200
size_y: 60
size_hint: None, None
size: self.size_x,self.size_y
pos: root.width/2 - self.size_x/2, 20
<PostureTracking>:
image: img
settingButton: settingButton
photoButton: photoButton
FloatLayout:
Image:
id: img
source: "textures/good.png"
allow_stretch: True
size: root.width, root.height
color: 1,1,1,1
Button:
id: settingButton
font_size: 20
text_size: self.size
text: "Settings"
color: 1,1,1,1
background_color: 0.9,0.9,0.9,1
size_x: 200
size_y: 60
size_hint: None, None
size: self.size_x, self.size_y
pos: root.width/2 - self.size_x * 1.1, 20
halign: 'center'
valign: 'middle'
Button:
id: photoButton
font_size: 20
text_size: self.size
text: "Take new photo"
color: 1,1,1,1
background_color: 0.9,0.9,0.9,1
size_x: 200
size_y: 60
size_hint: None, None
size: self.size_x, self.size_y
pos: root.width/2 + self.size_x * 0.1, 20
halign: 'center'
valign: 'middle'