Skip to content

Commit 1812c99

Browse files
committed
Merge pull request #4 from matthojo/ui-tests
Merging initial UI sounds
2 parents 2693035 + ce12c76 commit 1812c99

File tree

9 files changed

+16
-2
lines changed

9 files changed

+16
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
.svn
66
*~
77
manifest.appcache
8+
.idea/
89

910
/apps/system/camera
1011
/apps/settings/gaia-commit.txt

apps/homescreen/js/appmanager.js

-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ var Applications = (function() {
292292
if (!app) {
293293
return;
294294
}
295-
296295
app.launch(params);
297296
}
298297

apps/homescreen/js/grid.js

+7
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ const GridManager = (function() {
197197

198198
function activateIconNavigation() {
199199
console.log("Activating icon navigation");
200+
var s_hover = new Audio('./resources/sounds/hover.ogg');
201+
s_hover.play();
200202
isIconNavigation = true;
201203
pages[currentPage].activateIconNavigation();
202204
}
@@ -282,6 +284,7 @@ const GridManager = (function() {
282284
if (callback) {
283285
callback();
284286
}
287+
285288
});
286289

287290
var len = pages.length;
@@ -302,11 +305,15 @@ const GridManager = (function() {
302305
function goToNextPage(callback) {
303306
document.body.dataset.transitioning = 'true';
304307
goToPage(currentPage + 1, callback);
308+
var s_pageChangeR = new Audio('./resources/sounds/right.ogg');
309+
s_pageChangeR.play();
305310
}
306311

307312
function goToPreviousPage(callback) {
308313
document.body.dataset.transitioning = 'true';
309314
goToPage(currentPage - 1, callback);
315+
var s_pageChangeL = new Audio('./resources/sounds/left.ogg');
316+
s_pageChangeL.play();
310317
}
311318

312319
function updatePaginationBar() {

apps/homescreen/js/page.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,9 @@ Page.prototype = {
583583
* Navigation event handler
584584
*/
585585
handleNavigationEvent: function pg_handleNavigationEvent(evt, self) {
586-
switch (evt.type) {
586+
var s_hover = new Audio('./resources/sounds/hover.ogg');
587+
588+
switch (evt.type) {
587589
case 'keydown':
588590
// Return is 13
589591
// Left arrow is 37
@@ -592,13 +594,17 @@ Page.prototype = {
592594
// Down arrow is 40
593595
switch (evt.keyCode) {
594596
case 13:
597+
// Possibly need to move this sound
598+
var s_launch = new Audio('./resources/sounds/launch.ogg');
599+
s_launch.play();
595600
Applications.getByOrigin(self.currentIcon.descriptor.origin).launch();
596601
break;
597602
case 37:
598603
//console.log("Left");
599604
if (!self.currentIcon.container.previousSibling) {
600605
return;
601606
}
607+
s_hover.play();
602608
var newIcon = self.getIcon(self.currentIcon.container.previousSibling.dataset.origin);
603609
self.currentIcon.container.dataset.active = false;
604610
newIcon.container.dataset.active = true;
@@ -612,6 +618,7 @@ Page.prototype = {
612618
if (!self.currentIcon.container.nextSibling) {
613619
return;
614620
}
621+
s_hover.play();
615622
var newIcon = self.getIcon(self.currentIcon.container.nextSibling.dataset.origin);
616623
self.currentIcon.container.dataset.active = false;
617624
newIcon.container.dataset.active = true;
5.22 KB
Binary file not shown.
8.88 KB
Binary file not shown.
10.1 KB
Binary file not shown.
10.2 KB
Binary file not shown.
9.22 KB
Binary file not shown.

0 commit comments

Comments
 (0)