29
29
pos: self.parent.pos
30
30
size: self.parent.size
31
31
Image:
32
- source: 'icon.png'
32
+ source: 'icon/icon .png'
33
33
pos: self.pos
34
34
size: self.size
35
35
Button:
40
40
pos: self.parent.pos
41
41
size: self.parent.size
42
42
Image:
43
- source: 'music_icon.png'
43
+ source: 'icon/ music_icon.png'
44
44
pos: self.pos
45
45
size: self.size
46
46
Button:
51
51
pos: self.parent.pos
52
52
size: self.parent.size
53
53
Image:
54
- source: 'gallery.png'
54
+ source: 'icon/ gallery.png'
55
55
pos: self.pos
56
56
size: self.size
57
57
Button:
58
- text: "Button 4 "
58
+ text: ""
59
59
background_color: (0,1,0,0.5)
60
+ BoxLayout:
61
+ pos: self.parent.pos
62
+ size: self.parent.size
63
+ Image:
64
+ source: 'icon/credit.png'
65
+ pos: self.pos
66
+ size: self.size
60
67
61
68
<CameraScreen>:
62
69
BoxLayout:
76
83
pos: self.parent.pos
77
84
size: self.parent.size
78
85
Image:
79
- source: 'back.png'
86
+ source: 'icon/ back.png'
80
87
pos: self.pos
81
88
size: self.size
82
89
93
100
pos: self.parent.pos
94
101
size: self.parent.size
95
102
Image:
96
- source: 'capture.png'
103
+ source: 'icon/ capture.png'
97
104
pos: self.pos
98
105
size: self.size
99
106
100
107
<GalleryScreen>:
101
- name: "gallery"
102
- BoxLayout:
103
- id: gallery_layout
104
- Button:
105
- on_press: root.AddImage()
108
+ GridLayout:
109
+ orientation: 'vertical'
110
+ cols: 1
111
+ GridLayout:
112
+ cols: 2
113
+ padding: 5
114
+ spacing: 400
115
+ size_hint_y: None
116
+ height: self.minimum_height
117
+ Label:
118
+ text: "Gallery"
119
+ font_size: 40
120
+ Button:
121
+ text: "back"
122
+ on_press: root.manager.current = "start"
123
+ size_hint: None, None
124
+ height: '40dp'
125
+ width: '40dp'
126
+ ScrollView:
127
+ id: scroller
128
+ # size_hint:None, None
129
+ # size: 500, 320
130
+ # pos_hint: {'center_x': .5, 'center_y': .5},
131
+ # do_scroll_x:False
132
+
133
+ GridLayout:
134
+ cols: 4
135
+
136
+ padding: 10
137
+ spacing: 10
138
+ size_hint_y: None
139
+ height: self.minimum_height
140
+ id: gallery_layout
141
+
142
+ Image:
143
+ source: 'pics/yash.jpg'
144
+ size_hint_y: None
145
+ height: '40dp'
146
+ Image:
147
+ source: 'pics/yash.jpg'
148
+ size_hint_y: None
149
+ height: '240dp'
150
+ Image:
151
+ source: 'pics/yash.jpg'
152
+ size_hint_y: None
153
+ height: '240dp'
154
+ Image:
155
+ source: 'pics/yash.jpg'
156
+ size_hint_y: None
157
+ height: '240dp'
158
+ Image:
159
+ source: 'pics/yash.jpg'
160
+ size_hint_y: None
161
+ height: '240dp'
162
+ Image:
163
+ source: 'pics/yash.jpg'
164
+ size_hint_y: None
165
+ height: '240dp'
166
+ height: '240dp'
167
+ Image:
168
+ source: 'pics/yash.jpg'
169
+ size_hint_y: None
170
+ height: '240dp'
171
+ Image:
172
+ source: 'pics/yash.jpg'
173
+ size_hint_y: None
174
+ height: '240dp'
175
+ Image:
176
+ source: 'pics/yash.jpg'
177
+ size_hint_y: None
178
+ height: '240dp'
179
+ Image:
180
+ source: 'pics/yash.jpg'
181
+ size_hint_y: None
182
+ height: '240dp'
183
+ Image:
184
+ source: 'pics/yash.jpg'
185
+ size_hint_y: None
186
+ height: '240dp'
187
+
188
+ Image:
189
+ source: 'pics/yash.jpg'
190
+ size_hint_y: None
191
+ height: '240dp'
192
+ Image:
193
+ source: 'pics/yash.jpg'
194
+ size_hint_y: None
195
+ height: '240dp'
196
+ Image:
197
+ source: 'pics/yash.jpg'
198
+ size_hint_y: None
199
+ height: '240dp'
200
+ Image:
201
+ source: 'pics/yash.jpg'
202
+ size_hint_y: None
203
+ height: '240dp'
204
+ Image:
205
+ source: 'pics/yash.jpg'
206
+ size_hint_y: None
207
+
208
+ # Button:
209
+ # on_press: root.AddImage()
106
210
107
211
<AudioScreen>:
108
212
GridLayout:
109
- cols: 2
213
+ cols: 1
110
214
Button:
111
215
text: "hello"
112
- on_press: root.playmusic()
216
+ on_press: root.define()
217
+ Button:
218
+ id: btn
219
+ text: "press"
220
+
113
221
''' )
114
222
camera = ObjectProperty (None )
115
223
gallery_layout = ObjectProperty (None )
116
224
class StartScreen (Screen ):
117
225
pass
118
226
class AudioScreen (Screen ):
119
- def playmusic (self ):
120
- fname = 'example.wav'
121
- sound = SoundLoader .load (fname )
122
- # if sound is not None:
123
- # print "played"
124
- # sound.play()
125
- # else:
126
- # print "Doesn't exist"
227
+ def define (self ):
228
+ print "entered into define"
229
+ btn = self .ids ['btn' ]
230
+ btn .bind (on_press = self .playmusic )
231
+
232
+ def playmusic (self ,* args ):
233
+ print "played"
234
+ s = SoundLoader .load ('example.wav' )
235
+ print "hey executed"
236
+ # sound.volume = 0.5
237
+ # sound.play()
238
+
127
239
class CameraScreen (Screen ):
128
240
129
241
# def changei(x):
@@ -151,7 +263,7 @@ def AddImage(self):
151
263
sm .add_widget (GalleryScreen (name = "gallery" ))
152
264
sm .add_widget (AudioScreen (name = "audio" ))
153
265
class CameraApp (App ):
154
- sm .current = "start "
266
+ sm .current = "gallery "
155
267
def build (self ):
156
268
return sm
157
269
CameraApp ().run ()
0 commit comments