-
Notifications
You must be signed in to change notification settings - Fork 0
/
screens.kv
333 lines (266 loc) · 9.72 KB
/
screens.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
#:include add.kv
#:import MDDropdownMenu kivymd.uix.menu.MDDropdownMenu
<MyScreenManager>
<IngredientScreen>
id: ingredient_screen
name: 'ingredient_screen'
title: 'Cook Information'
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: root.title
elevation: 10
left_action_items: [['menu', lambda x: root.nav_drawer.set_state("toggle")]]
ScrollView:
MDGridLayout:
id: grid
cols: 1
adaptive_height: True
padding: '20dp', '4dp'
spacing: dp(4)
md_bg_color: app.theme_cls.bg_dark
MDLabel:
id: label1
text: 'Text'
halign: 'center'
valign: 'top'
font_style: 'H4'
size_hint_y: None
height: self.texture_size[1]
MDLabel:
id: label2
text: ''
halign: 'center'
valign: 'top'
font_style: 'H6'
size_hint_y: None
height: self.texture_size[1]
RelativeLayout:
size_hint: None, None
size: Window.width - dp(40), '270dp'
MDCard:
id: card
orientation: 'vertical'
background:
padding: '8dp'
size_hint: None, None
size: '270dp', '270dp'
pos_hint: {'center_x': .5, 'center_y': .5}
halign: 'center'
MDList:
id: list
TwoLineListItem:
id: cook_time
text: 'Cooking Time:'
secondary_text: ''
TwoLineListItem:
id: quick_release
text: 'Quick Release:'
secondary_text: ''
InfoItem:
id: tips
text: 'Tips'
secondary_text: 'N/A'
NoteItem:
id: notes
text: 'Notes'
secondary_text: 'Add your own notes here'
RelativeLayout:
id: rl
size_hint: None, None
width: Window.width - dp(40)
height: 0
<IngredientTile>
name: self.name
<StandardScreen>
name: self.name
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: root.title
elevation: 10
left_action_items: [['menu', lambda x: root.nav_drawer.set_state("toggle")]]
ScrollView:
MDGridLayout:
id: grid
cols: 2
row_default_height: (self.width - self.cols*self.spacing[0]) / self.cols
row_force_default: True
adaptive_height: True
padding: dp(4), dp(4)
spacing: dp(4)
md_bg_color: app.theme_cls.bg_dark
NewFoodButton:
id: add_btn
<CreditScreen>
name: self.name
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: root.title
elevation: 10
left_action_items: [['menu', lambda x: root.nav_drawer.set_state("toggle")]]
ScrollView:
MDList:
id: list
<CreditListItem>
IconLeftWidget:
icon: 'camera'
<NewFoodScreen>
id: new_food_screen
name: 'new_food_screen'
title: 'Add an Ingredient'
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: root.title
elevation: 10
left_action_items: [['menu', lambda x: root.nav_drawer.set_state("toggle")]]
ScrollView:
MDGridLayout:
id: grid
cols: 1
adaptive_height: True
adaptive_width: False
padding: '20dp', '4dp'
spacing: dp(4)
md_bg_color: app.theme_cls.bg_dark
MDLabel:
id: label1
text: 'NEW INGREDIENT:'
halign: 'center'
valign: 'top'
font_style: 'Subtitle1'
size_hint_y: None
height: self.texture_size[1]
MDDropDownItem:
id: food_type
pos_hint: {'center_x': .5, 'center_y': .5}
text: 'Choose ingredient type'
adaptive_size: False
size_hint_x: .8
RelativeLayout:
size_hint: None, None
size: Window.width - dp(40), card.height + dp(8)
PhotoCard:
id: card
background: ''
MDIcon:
id: card_icon
icon: ''#'image-plus'
halign: 'center'
font_size: '64sp'
pos_hint: {'center_x':.5, 'center_y': .55}
MDLabel:
id: card_label
text: ''#'UPLOAD IMAGE'
halign: 'center'
valign: 'bottom'
font_size: '20sp'
pos_hint: {'center_x':.5, 'center_y': .35}
MDTextField:
id: name1
hint_text: "Ingredient name"
color_mode: 'accent'
MDTextField:
id: name2
hint_text: "Variety (e.g., size, color, cut...)"
color_mode: 'accent'
MDTextField:
id: cook_time
hint_text: "Cook time"
color_mode: 'accent'
MDTextField:
id: quick_release
hint_text: "Quick release?"
color_mode: 'accent'
BoxLayout:
size_hint_y: None
height: tips.height
MDTextField:
id: tips
multiline: True
hint_text: "Enter tips (e.g. ratios)"
color_mode: 'accent'
BoxLayout:
size_hint_y: None
height: notes.height
MDTextField:
id: notes
multiline: True
hint_text: "Enter additional notes"
color_mode: 'accent'
RelativeLayout:
size_hint: None, None
size: Window.width - dp(40), cancel_btn.height
DiscardButton:
id: cancel_btn
icon: 'window-close'
text: 'DISCARD'
width: dp(270)
pos_hint: {'center_x': .5, 'center_y': .5}
halign: 'center'
RelativeLayout:
size_hint: None, None
size: Window.width - dp(40), add_btn.height
AddIngredientButton:
id: add_btn
icon: 'check-bold'
text: 'ADD INGREDIENT'
text_color: .22, .56, .24, 1
width: dp(270)
pos_hint: {'center_x': .5, 'center_y': .5}
halign: 'center'
<MenuScreen>
name: self.name
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
title: root.title
elevation: 10
left_action_items: [['menu', lambda x: root.nav_drawer.set_state("toggle")]]
ScrollView:
MDGridLayout:
cols: 2
row_default_height: (self.width - self.cols*self.spacing[0]) / self.cols
row_force_default: True
adaptive_height: True
padding: dp(4), dp(4)
spacing: dp(4)
md_bg_color: app.theme_cls.bg_dark
MenuTile:
name: 'veggie_screen'
source: "images/cauliflower.jpg"
text: "[size=14sp]VEGETABLES[/size]"
MenuTile:
name: 'meat_screen'
source: "images/chicken-whole.jpg"
text: "[size=14sp]MEAT & EGGS[/size]"
MenuTile:
name: 'grain_screen'
source: "images/oats.jpg"
text: "[size=14sp]RICE & GRAINS[/size]"
MenuTile:
name: 'bean_screen'
source: "images/blackeyedpeas.jpg"
text: "[size=14sp]BEANS & LENTILS[/size]\n[size=10sp]dry & soaked[/size]"
MenuTile:
name: 'fish_screen'
source: "images/clams.jpg"
text: "[size=14sp]SEAFOOD[/size]"
MenuTile:
name: 'credit_screen'
source: "logo_no_txt2.png"
text: "[size=14sp]CREDITS[/size]"
NewFoodButton:
id: add_btn