-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearn.kv
209 lines (188 loc) · 5.92 KB
/
learn.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
<EditCardPopup>:
container: container
size_hint: None, None
size: dp(340), dp(500)
title_size: 20
auto_dismiss: False
BoxLayout:
orientation: "vertical"
GridLayout:
id: container
cols: 2
row_default_height: dp(30)
cols_minimum: {0: dp(75), 1: dp(250)}
# spacing: 10, 10
# padding: 20, 20
size_hint: (None, None)
height: self.minimum_height
PopupLabelCell:
text: 'Question'
TextInput:
id: edit_q
PopupLabelCell:
text: 'Answer'
TextInput:
id: edit_a
PopupLabelCell:
text: 'Question Info'
TextInput:
id: edit_qi
PopupLabelCell:
text: 'Answer Info'
TextInput:
id: edit_ai
PopupLabelCell:
text: '*Streak'
TextInput:
id: edit_s
Label:
text: '*Streak of correct answers.\nDon\'t modify if you don\'t know\nwhat you are doing!'
Label:
id: alert
color: 1, 0, 0, 1
text: ''
BoxLayout:
size_hint_y: .8
spacing: 1
padding: 1
NavbarButton:
size_hint: 1, 0.4
text: "Save"
on_release:
root.save()
NavbarButton:
size_hint: 1, 0.4
text: "Delete"
on_release:
root.delete()
NavbarButton:
size_hint: 1, 0.4
text: "Cancel"
on_release:
root.cancel()
<LearnBatchLabel>:
orientation: 'horizontal'
padding: 0
spacing: 1
HiddenButton:
id: btn_left
halign: 'left'
valign: 'top'
on_press: root.set_correct()
size_hint: 1, 1
text_size: self.size[0] * .9, self.size[1] * .9
HiddenButton:
id: btn_right
halign: 'left'
valign: 'top'
on_press: root.reveal()
size_hint: 1, 1
text_size: self.size[0] * .9, self.size[1] * .9
<LearnBatchRV>:
viewclass: 'LearnBatchLabel'
RecycleBoxLayout:
id: rv_layout
orientation: 'vertical'
default_size: None, dp(42)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
<LearnScreen>:
set_info_label: set_info_label
learn_layout: learn_layout
layout_single: layout_single
layout_batch: layout_batch
box_batch_table: box_batch_table
BoxLayout:
orientation: 'vertical'
BoxLayout:
id: navbar
orientation: 'horizontal'
spacing: 1
padding: 1
size_hint_y: 1
NavbarButton:
text: 'Back'
on_press: root.manager.current = 'manage'
NavbarButton:
text: 'Delay 10hrs'
on_press: root.delay_current()
NavbarButton:
text: 'Mode'
on_press: root.switch_mode()
NavbarButton:
text: 'Edit'
on_press: root.edit_current()
Label:
id: set_info_label
size_hint_y: 1
color: .6, .6, .6, 1.
BoxLayout:
id: learn_layout
orientation: 'vertical'
size_hint_y: 10
BoxLayout:
id: layout_single
orientation: 'vertical'
BoxLayout:
id: questions
orientation: 'vertical'
size_hint_y: 7
HiddenButton:
id: q_next
text: 'foo'
color: .6, .6, .6, 1.
font_size: 14
on_press: root.reveal()
HiddenButton:
id: q_this
text: 'bar'
font_size: 20
on_press: root.reveal()
HiddenButton:
id: answer
text: 'hidden answer'
font_size: 20
on_press: root.reveal()
BoxLayout:
orientation: 'vertical'
size_hint_y: 3
BoxLayout:
orientation: 'horizontal'
spacing: 1
padding: 1
NavbarButton:
background_color: 0.173, 0.278, 0.439, 1.
text: 'wrong'
on_press: root.wrong_answer()
NavbarButton:
background_color: 0.29, 0.569, 0.188, 1.
text: 'correct'
on_press: root.right_answer()
BoxLayout:
id: layout_batch
orientation: 'vertical'
size_hint_y: 10
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.5
padding: 3
HiddenButton:
text: ''
BoxLayout:
id: box_batch_table
orientation: 'vertical'
size_hint_y: 8
BoxLayout:
orientation: 'vertical'
size_hint_y: 0.5
padding: 3
HiddenButton:
text: ''
BoxLayout:
orientation: 'vertical'
size_hint_y: 1
padding: 3
NavbarButton:
text: 'Submit'
on_press: root.submit_batch()