-
Notifications
You must be signed in to change notification settings - Fork 11
/
main.kv
212 lines (209 loc) · 7.4 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
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
#:import Window kivy.core.window.Window
#:import Factory kivy.factory.Factory
#:import FadeTransition kivy.uix.screenmanager.FadeTransition
#:import vibrator plyer.vibrator
#:set color_deep_purple [0.36862745098,0.20784313725 ,0.69411764705,1]
#:set color_deep_purple_dark [0.270588235,0.152941176 ,0.62745098,1]
#:set color_deep_purple_light [0.701960784,0.615686275 ,0.858823529,1]
#:set color_black [0.258823529,0.258823529 ,0.258823529,1]
#:set color_black_dark [0.129411765,0.129411765 ,0.129411765,1]
#:set color_black_light [0.811764706,0.847058824 ,0.862745098,1]
<Custom@FloatLayout>:
Label:
text: "[b][color=b39ddb]Age[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]Age[/color][/b]"
markup: True
font_size: self.size[0]/19
pos_hint: {'center_x':0.25, 'center_y': 0.97}
Label:
text: "[b][color=b39ddb]Height(cms)[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]Height(cms)[/color][/b]"
markup: True
font_size: self.size[0]/19
pos_hint: {'center_x':0.75, 'center_y': 0.97}
Label:
id: age
text: "[b][color=b39ddb]21[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]21[/color][/b]"
markup: True
font_size: self.size[0]/10
pos_hint: {'center_x':0.25, 'center_y': 0.9}
Label:
id: height
text: "[b][color=b39ddb]185[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]185[/color][/b]"
markup: True
font_size: self.size[0]/10
pos_hint: {'center_x':0.75, 'center_y': 0.9}
MDIconButton:
icon: "minus"
pos_hint: {'center_x':0.15, 'center_y': 0.83}
theme_text_color: "Custom"
text_color: color_deep_purple_light if app.theme=="purple" else color_black_light
on_press: root.age_decrement()
MDIconButton:
icon: "plus"
pos_hint: {'center_x':0.35, 'center_y': 0.83}
theme_text_color: "Custom"
text_color: color_deep_purple_light if app.theme=="purple" else color_black_light
on_press: root.age_increment()
MDIconButton:
icon: "minus"
pos_hint: {'center_x':0.65, 'center_y': 0.83}
theme_text_color: "Custom"
text_color: color_deep_purple_light if app.theme=="purple" else color_black_light
on_press: root.height_decrement()
MDIconButton:
icon: "plus"
pos_hint: {'center_x':0.85, 'center_y': 0.83}
theme_text_color: "Custom"
text_color: color_deep_purple_light if app.theme=="purple" else color_black_light
on_press: root.height_increment()
Label:
text: "[b][color=b39ddb]Weight(kg)[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]Weight(kg)[/color][/b]"
markup: True
font_size: self.size[0]/19
pos_hint: {'center_x':0.5, 'center_y': 0.71}
Label:
id: weightn
text: '[b][color=b39ddb]' + str(round(root.ids.weight.value)) + '[/color][/b]' if app.theme=="purple" else '[b][color=CFD8DC]' + str(round(root.ids.weight.value)) + '[/color][/b]'
markup: True
font_size: self.size[0]/10
pos_hint: {'center_x':0.5, 'center_y': 0.64}
BoxLayout:
padding: 10
orientation:"vertical"
pos_hint: {'center_x':0.5, 'center_y': 0.57}
MDLabel:
text: ""
halign: "center"
MDLabel:
text: ""
halign: "center"
MDSlider:
id: weight
min: 10
max: 150
value: 10
size_hint_x: None
size_hint_y: 1
width: Window.size[0]*0.75
hint: False
pos_hint: {'center_x':0.5, 'center_y': 0.57}
on_active: vibrator.vibrate(0.017)
MDLabel:
text: ""
halign: "center"
MDLabel:
text: ""
halign: "center"
MDSwitch:
pos_hint: {'center_x':0.5, 'center_y': 0.38}
active: True
on_active: vibrator.vibrate(0.017)
Label:
text: "[b][color=b39ddb]Male[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]Male[/color][/b]"
markup: True
font_size: self.size[0]/19
pos_hint: {'center_x':0.25, 'center_y': 0.38}
Label:
text: "[b][color=b39ddb]Female[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]Female[/color][/b]"
markup: True
font_size: self.size[0]/19
pos_hint: {'center_x':0.78, 'center_y': 0.38}
MDFloatingActionButton:
elevation: 0
icon: "google-fit"
user_font_size: Window.size[1]/18
pos_hint: {'center_x':0.5, 'center_y': 0.12}
theme_text_color: "Custom"
text_color: color_deep_purple_light if app.theme=="purple" else color_black_dark
on_press: root.bmi_calc()
on_release: root.ban_show()
<BoxContentForBottomSheetCustomScreenList>
orientation: "vertical"
padding: dp(10)
spacing: dp(10)
size_hint_y: None
height: self.minimum_height
pos_hint: {"top": 1}
ScrollView:
GridLayout:
id: box
size_hint_y: None
height: self.minimum_height
cols: 1
<Main_Screen@Screen>:
NavigationLayout:
ScreenManager:
canvas:
Color:
rgba: color_deep_purple if app.theme=="purple" else color_black
Rectangle:
pos: 0, 0
size: self.size[0], self.size[1]
Screen:
name: "root_screen"
ScreenManager:
id: screen_manager
transition: FadeTransition(duration=.2, clearcolor=app.theme_cls.bg_dark)
Screen:
name: "1"
GridLayout:
cols: 1
canvas:
Color:
rgba: color_deep_purple if app.theme=="purple" else color_black
Rectangle:
pos: 0, 0
size: self.size[0], self.size[1]
Label:
size_hint_y: '0.10'
GridLayout:
cols: 2
padding: 10
canvas:
Color:
rgba: color_deep_purple if app.theme=="purple" else color_black
Rectangle:
pos: 0, 0
size: self.size[0], self.size[1]
Color:
rgba: color_deep_purple_dark if app.theme=="purple" else color_black_dark
RoundedRectangle:
pos: self.size[1]/60, self.size[1]*0.75 + self.size[1]/60
size: self.size[0]/2 - self.size[1]/60 - self.size[1]/120, self.size[1]/4 - self.size[1]/60
radius: [20]
Color:
rgba: color_deep_purple_dark if app.theme=="purple" else color_black_dark
RoundedRectangle:
pos: self.size[0]/2 + self.size[1]/120, self.size[1]*0.75 + self.size[1]/60
size: self.size[0]/2 - self.size[1]/30 + self.size[1]/120, self.size[1]/4 - self.size[1]/60
radius: [20]
Color:
rgba: color_deep_purple_dark if app.theme=="purple" else color_black_dark
RoundedRectangle:
pos: self.size[1]/60, self.size[1]*0.50 + self.size[1]/60
size: self.size[0] - self.size[1]/15 + self.size[1]/30, self.size[1]/4 - self.size[1]/60
radius: [20]
Color:
rgba: color_deep_purple_dark if app.theme=="purple" else color_black_dark
RoundedRectangle:
pos: self.size[1]/60, self.size[1]*0.25 + self.size[1]/60
size: self.size[0] - self.size[1]/15 + self.size[1]/30, self.size[1]/4 - self.size[1]/60
radius: [20]
Color:
rgba: color_deep_purple_dark if app.theme=="purple" else color_black_dark
RoundedRectangle:
pos: self.size[1]/60, 0 + self.size[1]/60
size: self.size[0] - self.size[1]/15 + self.size[1]/30, self.size[1]/4 - self.size[1]/60
radius: [20]
Custom:
MDToolbar:
id: toolbar
pos_hint: {"top": 1}
elevation: 0
title: ""
left_action_items: [["menu", lambda x: app.show_example_bottom_sheet()]]
BoxLayout:
Label:
text: "[b][color=b39ddb]BMI Calculator[/color][/b]" if app.theme=="purple" else "[b][color=CFD8DC]BMI Calculator[/color][/b]"
markup: True
font_size: self.size[0]/8
pos_hint: {'center_x':0, 'center_y': 0.5}