-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.kv
150 lines (131 loc) · 4.07 KB
/
main.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
<WindowManager>:
id: _WindowManager
ExpiryDateWindow:
id: ExpiryDateWindow_id
ExpiryDateWindowWithList:
id: ExpiryDateWindowWithList_id
<ExpiryDateWindow>
name: "ExpiryPage"
lot: lot
lot_show: lot_show
exp_show: exp_show
MDRelativeLayout:
md_bg_color: (240/255, 240/255, 240/255, 1)
MDLabel:
height: 25
size_hint: (100, None)
#size_hint_x: 100
md_bg_color: app.theme_cls.accent_color
pos_hint: {"top":1}
MDToolbar:
title: "Lot lookup tool"
elevation: 10
md_bg_color: app.theme_cls.primary_color
pos_hint: {"top":.99}
right_action_items: [["view-list-outline", lambda x: root.display_list_page()]]
#Text input and search:
MDTextField:
id: lot
text: "B"
mode: "rectangle"
max_text_length: 7
multiline: False
pos_hint: {"x":0.075, "center_y":0.3}
size_hint: (0.5, 0.1)
MDRaisedButton:
text: "Search"
on_press:
#spinner.active = True
root.start_search_thread()
pos_hint: {"right":0.95, "center_y":0.3}
size_hint: (0.3, 0.1)
#Show lot# and expiry date:
MDLabel:
id: lot_show
text: ""
pos_hint: {"x":0.075, "center_y":0.4}
size_hint: (0.5, 0.1)
MDLabel:
id: exp_show
text: ""
halign: "center"
pos_hint: {"right":0.95, "center_y":0.4}
size_hint: (0.3, 0.1)
#loading button:
MDSpinner:
id: spinner
pos_hint: {'center_x': .5, 'center_y': .5}
size_hint: (0.15, 0.15)
color: app.theme_cls.accent_color
active: False
<ExpiryDateWindowWithList>
name: "ExpiryPageWithList"
lot: lot
lot_show: lot_show
exp_show: exp_show
MDRelativeLayout:
md_bg_color: (240/255, 240/255, 240/255, 1)
MDLabel:
height: 25
size_hint: (100, None)
md_bg_color: app.theme_cls.accent_color
pos_hint: {"top":1}
MDToolbar:
title: "Lot lookup tool"
elevation: 10
md_bg_color: app.theme_cls.primary_color
pos_hint: {"top":.99}
right_action_items: [["view-list-outline", lambda x: root.display_expiry_page()]]
#Text input and search:
MDTextField:
id: lot
text: "B"
mode: "rectangle"
max_text_length: 7
multiline: False
pos_hint: {"x":0.075, "center_y":0.3}
size_hint: (0.5, 0.1)
MDRaisedButton:
text: "Search"
on_press:
root.start_search_thread()
pos_hint: {"right":0.95, "center_y":0.3}
size_hint: (0.3, 0.1)
#Show lot# and expiry date:
MDLabel:
id: lot_show
pos_hint: {"x":0.075, "center_y":0.4}
size_hint: (0.5, 0.1)
MDLabel:
id: exp_show
halign: "center"
pos_hint: {"right":0.95, "center_y":0.4}
size_hint: (0.3, 0.1)
MDCard:
size_hint: (0.9,0.4)
pos_hint: {"center_x":0.5, "center_y":0.65}
md_bg_color: app.theme_cls.primary_color
radius: [16, ]
MDBoxLayout:
orientation: "vertical"
size_hint_y: 0.95
ScrollView:
scroll_timeout: 100
MDList:
id: md_list
padding: 0
<SwipeToDeleteItem>:
size_hint_y: None
height: content.height
MDCardSwipeLayerBox:
padding: 0.4
MDIconButton:
icon: "trash-can"
pos_hint: {"center_y": .5}
on_release: root.remove_item(root)
MDCardSwipeFrontBox:
TwoLineListItem:
id: content
text: root.text
secondary_text: root.secondary_text
_no_ripple_effect: True