-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmy.kv
90 lines (89 loc) · 3.46 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
<WeatherDashboard>:
ScreenManager:
id: _screen_manager
Screen:
name: 'screen1'
BoxLayout:
spacing: 4
orientation: 'vertical'
canvas:
Rectangle:
pos: self.pos
size: self.size
source: root.bg_pic
BoxLayout:
size_hint: (1, 0.2)
Label:
size_hint: (0.9, 1)
font_size: 48
text: "Weather App"
Button:
size_hint: (0.1, 1)
text: "setting"
background_normal: 'icons/setting-148.png'
on_press: _screen_manager.current = 'screen2'
BoxLayout:
size_hint: (1, 0.8)
orientation: 'vertical'
canvas:
Color:
rgba: (0, 0, 0, 0.6)
Rectangle:
pos: (self.center_x - self.width * 0.4, self.center_y * 0.4)
size: (self.width * 0.8, self.height * 0.8)
Image:
source: "icons/cloudy-256.png"
BoxLayout:
Label:
text: root.location
font_size: 32
Label:
font_size: 24
text: 'Temperature: ' + str(root.degree)
Label:
font_size: 24
text: 'Humidity: ' + str(root.humid) + '%'
Screen:
name: 'screen2'
BoxLayout:
spacing: 4
orientation: 'vertical'
canvas:
Rectangle:
pos: self.pos
size: self.size
source: 'wether-photos/sunny.jpg'
BoxLayout:
size_hint: (1, 0.2)
#TODO change to image
# Image:
# source: 'icons/back.png'
Button: # temp
text: "Back"
background_normal: "icons/back.png"
size_hint: (0.1, 1)
on_press: _screen_manager.current = 'screen1'
Label:
size_hint: (0.9, 1)
font_size: 48
text: "Location"
GridLayout:
size_hint: (1, 0.8)
cols: 3
padding: [100] * 4
ToggleButton:
text: "Taipei"
group: 'area'
on_press: root.change_location('Taipei')
ToggleButton:
group: 'area'
text: "Taoyuan"
on_press: root.change_location('Taoyuan')
ToggleButton:
group: 'area'
text: "Keelung"
on_press: root.change_location('Keelung')
ToggleButton:
group: 'area'
text: "Hsinchu"
on_press: root.change_location('Hsinchu')