-
Notifications
You must be signed in to change notification settings - Fork 0
/
kivy.kv
399 lines (318 loc) · 8.34 KB
/
kivy.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
#:kivy 1.0.9
<LoginScreen>:
name: 'login'
rut: Rut
password_input: password
rutlabel: rutlabel
passwordlabel: passwordlabel
errorlabel: errorlabel
TextInput:
id: Rut
pos_hint: {'x':0.15, 'y':0.55}
hint_text: 'Ingrese su rut'
on_text_validate: root.rut_template()
Label:
id: rutlabel
pos_hint: {'x':0.85, 'y':0.55}
size_hint: .1, .1
text: ''
TextInput:
id: password
pos_hint: {'x':0.15, 'y':0.45}
hint_text: 'Ingrese su contraseña'
on_text_validate: root.login()
Label:
id: passwordlabel
pos_hint: {'x':0.85, 'y':0.45}
size_hint: .1, .1
text: ''
Label:
id: errorlabel
pos_hint: {'x':0.15, 'y': 0.35}
size_hint: 0.7, 0.10
text: ''
Button:
text: "A ganar transpuntos"
size_hint: 0.7, 0.10
pos_hint: {'x':0.15, 'y':0.25}
on_press:
root.login()
Label:
text: '¿No tienes una cuenta METRO? \n Regístrate apretando el botón'
size_hint: 0.7, 0.1
pos_hint: {'x':0.15, 'y':0.10}
Button:
text: "Registrarse"
size_hint: 0.7, 0.1
pos_hint:{'x':0.15, 'y':0}
on_press: root.manager.current = 'register'
<RegistrationScreen>:
rut: rut
email: email
nombre: nombre
apellidos: apellidos
bip: bip
password: password
nombrelabel: nombrelabel
apellidoslabel: apellidoslabel
emaillabel: emaillabel
rutlabel: rutlabel
biplabel: biplabel
passwordlabel: passwordlabel
name: 'register'
Label:
text: 'Ingrese sus datos'
size_hint: 0.7, 0.10
pos_hint:{'x':0.15, 'y':0.80}
TextInput:
id: nombre
pos_hint: {'x':0.15, 'y':0.65}
hint_text: 'Ingrese su nombre'
on_text_validate:
root.apellidos.focus = True
Label:
id: nombrelabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.65}
size_hint: 0.1, 0.1
TextInput:
id: apellidos
pos_hint: {'x':0.15, 'y':0.55}
hint_text: 'Ingrese sus apellidos'
on_text_validate:
root.email.focus = True
Label:
id: apellidoslabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.55}
size_hint: 0.1, 0.1
TextInput:
id: email
pos_hint: {'x':0.15, 'y':0.45}
hint_text: 'Ingrese su correo electrónico'
on_text_validate:
root.email_validation()
root.rut.focus = True
Label:
id: emaillabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.45}
size_hint: 0.1, 0.1
TextInput:
id: rut
pos_hint: {'x':0.15, 'y':0.35}
hint_text: 'Ingrese su rut'
on_text_validate:
root.rut_template()
root.bip.focus = True
Label:
id: rutlabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.35}
size_hint: 0.1, 0.1
TextInput:
id: bip
pos_hint: {'x':0.15, 'y':0.25}
hint_text: 'Ingrese el código de su tarjeta bip'
Label:
id: biplabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.25}
size_hint: 0.1, 0.1
TextInput:
hint_text: 'Cree una contraseña'
id: password
pos_hint:{'x':0.15, 'y':0.15}
on_text_validate: root.password_check()
Label:
id: passwordlabel
text_size: self.width, None
pos_hint: {'x': 0.85, 'y': 0.15}
size_hint: 0.1, 0.1
Button:
text: 'Volver'
size_hint: .15, .15
on_release: root.manager.current = 'login'
Button:
text: 'Registrarse'
size_hint: .15, .15
pos_hint: {'x':0.85, 'y':0}
on_release: root.data_check()
<Transpuntos>:
name: 'lol'
catito: catito
AsyncImage:
size_hint: 0.5, 0.5
pos_hint: {'x':0.25, 'y': 0.25}
id: catito
source: None
Button:
text: 'Foto gatito'
size_hint: 0.2, 0.2
on_release: root.get_cat_image()
Button:
text: 'Mucho gatito'
size_hint: 0.2, 0.2
pos_hint: {'x': 0.8, 'y':0}
on_press:
root.manager.current = 'login'
<UserMain>:
name: 'usermain'
bienvenida: bienvenida
Button:
text: 'Calificar servicio'
size_hint: 0.7, 0.3
pos_hint: {'x': 0.15, 'y': 0.45}
font_size: self.width/10
on_release:
root.manager.current = 'ratingqr'
root.manager.get_screen('ratingqr').start_camera()
Button:
text: 'Revisar recorridos'
size_hint: 0.7, 0.15
pos_hint: {'x': 0.15, 'y': 0.30}
Button:
text: 'Canjear puntos'
size_hint: 0.7, 0.15
pos_hint: {'x': 0.15, 'y': 0.15}
on_press:
root.manager.current= 'lol'
Label:
id: bienvenida
size_hint: 0.4, 0.1
pos_hint: {'x':0, 'y': 0.85}
<UserRatingQR>:
name: 'ratingqr'
fotoqr: fotoqr
patent_input: patent_input
patent_label: patent_label
Button:
text: 'Volver'
size_hint: 0.1, 0.1
on_press:
root.manager.current = 'usermain'
root.end_camera()
Image:
id: fotoqr
size_hint: 0.7, 0.7
pos_hint: {'x':0.15, 'y':0.25}
TextInput:
id: patent_input
hint_text: 'Patente de la micro. ej. AABB33'
size_hint: 0.7, 0.1
pos_hint: {'x': 0.15, 'y': 0.15}
Label:
id: patent_label
size_hint: 0.15, 0.1
pos_hint: {'x': 0.85, 'y': 0.15}
text: ''
Button:
text: 'Calificar micro'
size_hint: 0.5, 0.15
pos_hint: {'x': 0.25, 'y': 0}
on_release:
root.check_patent(patent_input.text)
root.camara = False
<WorkerMain>:
name: "workermain"
contador_hora: contador_hora
boton_contador: boton_contador
Button:
text: 'Encuestas'
size_hint: 0.7, 0.3
pos_hint: {'x':0.15, 'y':0.55}
Button:
text: 'Incidentes'
size_hint: 0.7, 0.15
pos_hint: {'x':0.15, 'y':0.4}
Button:
text: 'Pedir hora psicológica'
size_hint: 0.7, 0.15
pos_hint: {'x':0.15, 'y':0.25}
Label:
id: contador_hora
text: '00:00:00'
size_hint: 0.7, 0.15
pos_hint: {'x':0.15, 'y':0.05}
Button:
id: boton_contador
text: 'Comenzar trabajo'
size_hint: 0.1, 0.1
pos_hint: {'x':0.85, 'y':0.05}
on_release:
root.boton()
<TextInput>:
size_hint: 0.7, 0.10
multiline: False
write_tab: False
<RatingScreen>:
pregunta1: pregunta1
pregunta2: pregunta2
pregunta3: pregunta3
pregunta4: pregunta4
pregunta5: pregunta5
respuesta1: respuesta1
respuesta2: respuesta2
respuesta3: respuesta3
respuesta4: respuesta4
respuesta5: respuesta5
BoxLayout:
orientation: 'vertical'
Label:
id: pregunta1
text: ''
Slider:
id: respuesta1
min: 1
max: 5
step: 1
value: 3
value_track: True
Label:
id: pregunta2
text: ''
Slider:
id: respuesta2
min: 1
max: 5
step: 1
value: 3
Label:
id: pregunta3
text: ''
Slider:
id: respuesta3
min: 1
max: 5
step: 1
value: 3
Label:
id: pregunta4
text: ''
Slider:
id: respuesta4
min: 1
max: 5
step: 1
value: 3
Label:
id: pregunta5
text: ''
Slider:
id: respuesta5
min: 1
max: 5
step: 1
value: 3
Button:
text: 'Enviar respuestas'
on_release: root.enviar_encuesta()
<AdministratorMain>:
name: 'adminmain'
BoxLayout:
orientation: 'vertical'
Button:
text: 'Informe general'
on_release:
root.report()
root.manager.current = 'login'