-
Notifications
You must be signed in to change notification settings - Fork 0
/
weather.kv
62 lines (54 loc) · 1.45 KB
/
weather.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
#: import main main
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
WeatherRoot:
<WeatherRoot>:
AddLocationForm:
<AddLocationForm>:
orientation: "vertical"
search_input: search_box
search_results: search_results_list
BoxLayout:
height: "40dp"
size_hint_y: None
TextInput:
id: search_box
size_hint_x: 50
focus: True
multiline: False
on_text_validate: root.search_location()
Button:
text: "Search"
size_hint_x: 25
on_press: root.search_location()
Button:
text: "Current Location"
size_hint_x: 25
ListView:
id: search_results_list
adapter:
ListAdapter(data=[], cls=main.LocationButton)
Button:
height: '40dp'''
size_hint_y: None
text: 'Cancel'
on_press: app.root.show_current_weather(None)
<LocationButton>:
# on_press: app.root.show_current_weather(self.text)
<CurrentWeather@BoxLayout>:
location: ['New York', 'US']
conditions: None
temp: None
temp_min: None
temp_max: None
orientation: 'vertical'
Label:
text: root.location
BoxLayout:
orientation: 'horizontal'
size_hint_y: None
height: '40dp'
Button:
text: 'Add Location'
on_press: app.root.show_add_location_form()
Button:
text: 'Forecast'