This repository has been archived by the owner on May 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvitevite.kv
199 lines (185 loc) · 6.1 KB
/
vitevite.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
#: import sm kivy.uix.screenmanager
#: import log kivy.logger.Logger
###################################
##
## SCREEN TEMPLATE
##
###################################
## This template describes the layout of each application screen
<AppScreen>:
ScrollView:
FloatLayout:
#Make sure there is no horizontal scroll bar
do_scroll_y: False
canvas:
Color:
rgb: 255,255,255
Rectangle:
size: self.size
Color:
rgba: 0,0,0,1
Line:
points: self.x + 15, self.top - self.height/8, self.width - 15, self.top -self.height/8
Label:
id: root.name
text: root.header
size_hint: 1, .2
pos_hint: {'y': .82 }
font_size: 15
color: 0,0,0,1
#####################################
##
## SPINNER MODS
##
#####################################
## This is a modification of the original spinner widget
## It better corresponds to Android style requirements
<AppSpinner>:
color: 255,255,255,.85
font_size: 16
background_color: 0,0,0,1
on_press: if not self.is_open: self.background_color = 0,0,0,255,1
on_release: self.background_color = 0,0,0,1
size_hint: None, 1
width: 220
canvas.after:
Color:
rgb: 255,255,255,.8
Triangle:
points: self.right, self.center_y,self.right-16,self.center_y, self.right - 8, self.center_y - 8
<SpinnerOption>:
background_color: 0,0,0,1
color: 255,255,255,.85
font_size: 16
size_hint_y: None
height: 100
<AppDropDown>:
auto_width: False
size_hint: None, None
width: 300
## Widget mix-ins
## These mix-ins are described in main.py
#
<ImageButton>:
width: self.texture_size[0]
button_grab: True
<BoxButton>:
button_grab: True
BoxLayout:
id: toolkit
orientation: 'vertical'
height: 800
width: 480
AnchorLayout:
anchor_y: 'top'
size_hint: 1, .1
GridLayout:
size_hint: 1, 1
cols: 3
rows: 1
BoxLayout:
size_hint: None, 1
width: 30
spacing: 10
orientation: 'horizontal'
ImageButton:
canvas:
Color:
rgba: 255,255,255,.8
Line:
points: self.x,self.y,self.x,self.y+self.height
on_press: screen_manager.current = screen_manager.previous()
source: 'assets/drawable-mdpi/1-navigation-previous-item.png'
AppSpinner:
id: screen_menu
text: screen_manager.current
values: screen_manager.screen_names
AnchorLayout:
anchor_x: 'right'
BoxLayout:
size_hint: None, 1
width: 75
spacing: 30
orientation: 'horizontal'
ImageButton:
on_press: screen_manager.current = 'Help Screen'
source: 'assets/drawable-mdpi/2-action-help.png'
canvas:
Color:
rgba: 255,255,255,.8
Line:
points: self.x,self.y,self.x,self.y+self.height
ScreenManager:
transition: sm.SlideTransition()
id: screen_manager
current: screen_menu.text
HelpScreen:
id: screen1
header: self.specialvar
name: 'Help Screen'
MainScreen:
id: screen2
header: "This is the main screen header"
name: 'Main Screen'
ContentScreen:
id: screen3
header: "This is the content screen"
name: 'Content Screen'
EditScreen:
id: screen4
header: "This is the edit screen"
name: 'Edit Screen'
AddScreen:
id: screen5
header: "This is the add screen"
name: 'Add Screen'
# If the code below seems repetitive, it is. I wish there were an easy way to fix it.
# The problem is that I can't use Kivy templates because I use dynamic property values
AnchorLayout:
id: bottom_anchor
anchor_y: 'bottom'
size_hint: 1, .2
BoxLayout:
size_hint: 1,1
orientation: 'horizontal'
BoxButton:
orientation: 'vertical'
spacing: -5
padding: 10
on_press: screen_manager.current = 'Content Screen'
canvas:
Color:
rgba: 255,255,255,.8
Line:
points: self.x+self.width,self.y,self.x+self.width,self.y+self.height
Image:
source: 'assets/drawable-hdpi/4-collections-collection.png'
Label:
text: 'Contents Screen'
BoxButton:
orientation: 'vertical'
spacing: -5
padding: 10
on_press: screen_manager.current = 'Add Screen'
canvas:
Color:
rgba: 255,255,255,.8
Line:
points: self.x+self.width,self.y,self.x+self.width,self.y+self.height
Image:
source: 'assets/drawable-hdpi/5-content-new.png'
Label:
text: 'Add Content'
BoxButton:
orientation: 'vertical'
spacing: -5
padding: 10
on_press: screen_manager.current = 'Edit Screen'
Image:
source: 'assets/drawable-hdpi/5-content-edit.png'
Label:
text: 'Edit Screen'
# AppMenu:
# id: app_menu
# text: screen_manager.current
# values: screen_manager.screen_names