Skip to content

Commit

Permalink
dtlaunch: add interaction-buzz setting
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrippling committed Jul 14, 2023
1 parent e408fb9 commit bbdf943
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion apps/dtlaunch/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ immediately follows the correct theme.
0.22: Bangle 2: Change to not automatically marking the first app on a page
when moving pages. Add caching for faster startups.
0.23: Bangle 1: Fix issue with missing icons, added touch screen interactions

0.24: Add buzz-on-interaction setting
15 changes: 14 additions & 1 deletion apps/dtlaunch/app-b2.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
showLaunchers: true,
direct: false,
swipeExit: false,
timeOut: "Off"
timeOut: "Off",
interactionBuzz: false,
}, require('Storage').readJSON("dtlaunch.json", true) || {});

let s = require("Storage");
Expand Down Expand Up @@ -89,6 +90,13 @@
g.flip();
};

let buzzShort = function() {
if (settings.interactionBuzz) Bangle.buzz(20);
};
let buzzLong = function() {
if (settings.interactionBuzz) Bangle.buzz(100);
};

Bangle.drawWidgets(); // To immediately update widget field to follow current theme - remove leftovers if previous app set custom theme.
Bangle.loadWidgets();
drawPage(0);
Expand All @@ -100,9 +108,11 @@
if(settings.swipeExit && dirLeftRight==1) Bangle.showClock();
if (dirUpDown==-1||dirLeftRight==-1){
++page; if (page>maxPage) page=0;
buzzShort();
drawPage(page);
} else if (dirUpDown==1||(dirLeftRight==1 && !settings.swipeExit)){
--page; if (page<0) page=maxPage;
buzzShort();
drawPage(page);
}
};
Expand All @@ -123,8 +133,10 @@
drawIcon(page,i,true && !settings.direct);
if (selected>=0 || settings.direct) {
if (selected!=i && !settings.direct){
buzzShort();
drawIcon(page,selected,false);
} else {
buzzLong();
load(apps[page*4+i].src);
}
}
Expand All @@ -134,6 +146,7 @@
}
}
if ((i==4 || (page*4+i)>Napps) && selected>=0) {
buzzShort();
drawIcon(page,selected,false);
selected=-1;
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dtlaunch/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "dtlaunch",
"name": "Desktop Launcher",
"version": "0.23",
"version": "0.24",
"description": "Desktop style App Launcher with six (four for Bangle 2) apps per page - fast access if you have lots of apps installed.",
"screenshots": [{"url":"shot1.png"},{"url":"shot2.png"},{"url":"shot3.png"}],
"icon": "icon.png",
Expand Down
12 changes: 10 additions & 2 deletions apps/dtlaunch/settings-b2.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
showLaunchers: true,
direct: false,
swipeExit: false,
timeOut: "Off"
timeOut: "Off",
interactionBuzz: false,
}, require('Storage').readJSON(FILE, true) || {});

function writeSettings() {
Expand Down Expand Up @@ -55,6 +56,13 @@
settings.timeOut = timeOutChoices[v];
writeSettings();
}
}
},
/*LANG*/'Interaction buzz': {
value: settings.interactionBuzz,
onchange: v => {
settings.interactionBuzz = v;
writeSettings();
}
},
});
});

0 comments on commit bbdf943

Please sign in to comment.