forked from keerthan0/Kivy-Music-Player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy.kv
340 lines (302 loc) · 13.7 KB
/
my.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
#:import toast kivymd.toast.toast
NavigationLayout:
ScreenManager:
id: screen_manager
Screen:
id: MainScreen
name: 'MainScreen'
song_name: song_name
MDBottomNavigation:
elevation: 10
panel_color: app.theme_cls.bg_light if app.theme_cls.theme_style == 'Dark' else app.theme_cls.bg_dark
MDBottomNavigationItem:
name: 'home'
text: 'Search'
icon: 'magnify'
MDIconButton:
icon: 'music'
pos_hint: {"center_x":0.5, "center_y":0.75}
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color
user_font_size: "300sp"
MDIconButton:
icon: 'menu'
pos_hint: {"center_x":0.05, "center_y":0.95}
on_press: nav_drawer.set_state("open")
MDCard:
size_hint: None, None
pos_hint: {'center_x':0.5, 'center_y':0.5}
size_hint: 0.7,0.06
elevation: 8
radius: [10,]
border_radius: 10
MDTextFieldRound:
id: song_name
hint_text: "Songs, artists or podcasts"
helper_text: "Enter song name here"
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
size_hint: 0.6, 0.05
line_color: app.theme_cls.bg_light
normal_color: app.theme_cls.bg_light
color_active: app.theme_cls.bg_light
foreground_color: app.theme_cls.secondary_text_color
helper_text_mode: "on_focus"
icon_left: "magnify"
icon_left_color: app.theme_cls.text_color if self.text == '' else app.theme_cls.primary_color
MDCard:
size_hint: None, None
pos_hint: {'center_x':0.5, 'center_y':0.4}
size : search_btn.size
elevation: 10
radius:[3,]
border_radius:3
MDRaisedButton:
id: search_btn
text: 'SEARCH'
pos_hint: {'center_x':0.5, 'center_y':0.5}
md_bg_color: app.theme_cls.primary_color
text_color: (1,1,1,1)
on_press:
app.show_data(song_name.text)
MDBottomNavigationItem:
name: 'trending'
text: 'Trending'
icon: 'trending-up'
on_tab_press: app.add_trend()
ScrollView:
MDGridLayout:
id: trend_grid
cols: 1
padding: 20
spacing: 10
size_hint_y: None
height: self.minimum_height
MDBottomNavigationItem:
name: 'top'
text: 'Top 200'
icon: 'chart-line'
on_tab_press: app.add_top()
id: rv
ScrollView:
MDList:
id: top_list
Screen:
id: SongListScreen
name: 'SongListScreen'
BoxLayout:
orientation: 'vertical'
MDToolbar:
title: 'Results'
elevation: 10
left_action_items: [['chevron-left', lambda x: app.back_screen()]]
ScrollView:
size_hint: (1, 2.5)
MDList:
id: container
Screen:
id: TrendListScreen
name: 'TrendListScreen'
BoxLayout:
orientation: 'vertical'
MDToolbar:
id: trend_toolbar
title: ''
elevation: 10
left_action_items: [['chevron-left', lambda x: app.back_screen()]]
ScrollView:
size_hint: (1, 2.5)
MDList:
id: trend_list
Screen:
id: SongDetailsScreen
name: 'SongDetailsScreen'
BoxLayout:
id: detailsbox
orientation: 'vertical'
Screen:
id: DownloadsScreen
name: 'DownloadsScreen'
BoxLayout:
orientation: 'vertical'
MDToolbar:
title: 'My Music'
elevation: 10
left_action_items: [['chevron-left', lambda x: app.back_screen()]]
ScrollView:
size_hint: (1, 2.5)
MDList:
id: downloadlist
Screen:
id: PlayScreen
name: 'PlayScreen'
BoxLayout:
orientation: 'vertical'
Screen:
id: AboutScreen
name: 'AboutScreen'
BoxLayout:
orientation: 'vertical'
size_hint: 1, 0.5
pos_hint: {'center_x': 0.5, 'center_y': 0.75}
MDToolbar:
elevation: 10
title: 'About'
left_action_items: [['chevron-left', lambda x: app.back_screen()]]
Image:
source: './made-black.png' if app.theme_cls.theme_style == "Light" else './made-white.png'
MDCard:
size_hint: None, None
pos_hint: {'center_x':0.5, 'center_y':0.4}
size : contact_btn.size
elevation: 5
MDRectangleFlatButton:
id: contact_btn
text: 'Contact'
pos_hint: {'center_x':0.5, 'center_y':0.5}
text_color: app.theme_cls.primary_color
on_press:
app.contact_us()
Screen:
id: SettingsScreen
name: 'SettingsScreen'
BoxLayout:
orientation: 'vertical'
size_hint: 1, 0.5
pos_hint: {'center_x': 0.5, 'center_y': 0.75}
MDToolbar:
elevation: 10
title: 'Settings'
left_action_items: [['chevron-left', lambda x: app.back_screen()]]
FloatLayout:
MDLabel:
text: "Dark Mode"
padding_x: "30dp"
theme_text_color: 'Primary'
pos_hint: {'center_y': .9}
MDSwitch:
id: dark_mode_switch
active: False
pos_hint: {'center_x': 0.9, 'center_y': .9}
on_active: app.change_theme()
MDLabel:
text: "Current version"
padding_x: "30dp"
theme_text_color: 'Primary'
pos_hint: {'center_y': 0.5}
MDTextButton:
text: "v"+app.__version__ + "-alpha"
padding_x: "30dp"
custom_color: app.theme_cls.secondary_text_color
pos_hint: {'center_x':0.9, 'center_y': 0.5}
on_press: toast("Alpha v0.7")
MDLabel:
text: "Download location"
padding_x: "30dp"
theme_text_color: 'Primary'
pos_hint: {'center_y': 0.7}
MDTextButton:
text: app.path
padding_x: "30dp"
custom_color: app.theme_cls.secondary_text_color
pos_hint: {'center_x':0.9, 'center_y': 0.7}
on_press: app.file_manager_open()
MDTextButton:
text: "Check for Update"
padding_x: "30dp"
custom_color: app.theme_cls.text_color
pos_hint: {'center_y': 0.3}
on_press: app.check_update()
MDNavigationDrawer:
id: nav_drawer
BoxLayout:
orientation: 'vertical'
padding: ("10dp","20dp")
spacing: "8dp"
AnchorLayout:
anchor_x: "left"
padding: "20dp"
size_hint_y: None
height: avatar.height
Image:
id: avatar
size_hint: None, None
size: "56dp", "56dp"
source: "icon-black.png"
MDLabel:
text: "Black Hole"
padding_x: "20dp"
font_style: "Button"
size_hint_y: None
height: self.texture_size[1]
theme_text_color: 'Primary'
MDLabel:
text: "[email protected]"
padding_x: "20dp"
font_style: "Caption"
size_hint_y: None
height: self.texture_size[1]
theme_text_color: 'Secondary'
ScrollView:
MDList:
id: nav_list
OneLineIconListItem:
text: 'Home'
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'MainScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('MainScreen', 'right')
IconLeftWidget:
icon: 'home-outline'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'MainScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('MainScreen', 'right')
OneLineIconListItem:
text: 'My Music'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'DownloadsScreen' else app.theme_cls.text_color
on_release:
app.download_list()
nav_drawer.set_state("close")
app.change_screen('DownloadsScreen')
IconLeftWidget:
icon: 'folder-outline'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'DownloadsScreen' else app.theme_cls.text_color
on_release:
app.download_list()
nav_drawer.set_state("close")
app.change_screen('DownloadsScreen')
OneLineIconListItem:
text: 'Settings'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'SettingsScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('SettingsScreen')
IconLeftWidget:
icon: 'cogs'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'SettingsScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('SettingsScreen')
OneLineIconListItem:
text: 'About'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'AboutScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('AboutScreen')
IconLeftWidget:
icon: 'information-outline'
theme_text_color: "Custom"
text_color: app.theme_cls.primary_color if screen_manager.current == 'AboutScreen' else app.theme_cls.text_color
on_release:
nav_drawer.set_state("close")
app.change_screen('AboutScreen')
<Tab>:
id: label