1
0
Fork 0

Merge pull request #2825 from kevdliu/folder-launcher-vib-setting

[folderlaunch] Add setting to disable vibration
master
Gordon Williams 2023-06-15 08:54:57 +01:00 committed by GitHub
commit fc92e407d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 42 additions and 25 deletions

View File

@ -1,2 +1,3 @@
0.01: New app!
0.02: Handle files potentially not existing
0.03: Add setting to disable vibration

View File

@ -15,6 +15,8 @@ Swiping up and down will scroll. Swiping from the left, using the back button, o
* Show clocks / Show launcher: Whether clock and launcher apps are displayed in the UI to be launched. The default is no.
* Disable vibration: Whether vibration is disabled in the launcher. The default is no.
* Hidden apps: Displays the list of installed apps, enabling them to be manually hidden. (Or unhidden, if hidden from here.) This may be convenient for apps that you have some other shortcut to access, or apps that are only shortcuts to an infrequently used settings menu. By default, no apps are hidden.
* Display:

View File

@ -133,12 +133,12 @@
var entry = grid_1[x][y];
switch (entry.type) {
case "app":
Bangle.buzz();
buzz_1();
var infoFile = storage_1.readJSON(entry.id + '.info', false);
load(infoFile.src);
break;
case "folder":
Bangle.buzz();
buzz_1();
resetTimeout_1();
page_1 = 0;
folderPath_1.push(entry.id);
@ -160,7 +160,7 @@
else if (ud == 1) {
resetTimeout_1();
if (page_1 == 0) {
Bangle.buzz(200);
buzz_1(200);
return;
}
else
@ -169,7 +169,7 @@
else if (ud == -1) {
resetTimeout_1();
if (page_1 == nPages_1 - 1) {
Bangle.buzz(200);
buzz_1(200);
return;
}
else
@ -178,7 +178,7 @@
render_1();
};
var onBackButton_1 = function () {
Bangle.buzz();
buzz_1();
if (folderPath_1.length == 0)
Bangle.showClock();
else {
@ -189,6 +189,7 @@
render_1();
}
};
var buzz_1 = config_1.disableVibration ? function () { } : Bangle.buzz;
Bangle.loadWidgets();
Bangle.drawWidgets();
Bangle.setUI({

View File

@ -185,12 +185,12 @@
let entry: GridEntry = grid[x]![y]!;
switch (entry.type) {
case "app":
Bangle.buzz();
buzz();
let infoFile = storage.readJSON(entry.id + '.info', false) as AppInfo;
load(infoFile.src);
break;
case "folder":
Bangle.buzz();
buzz();
resetTimeout();
page = 0;
folderPath.push(entry.id);
@ -221,13 +221,13 @@
} else if (ud == 1) {
resetTimeout();
if (page == 0) {
Bangle.buzz(200);
buzz(200);
return;
} else page--;
} else if (ud == -1) {
resetTimeout();
if (page == nPages - 1) {
Bangle.buzz(200);
buzz(200);
return;
} else page++;
}
@ -240,7 +240,7 @@
* Go back up a level. If already at the root folder, exit the launcher
*/
let onBackButton = () => {
Bangle.buzz();
buzz();
if (folderPath.length == 0)
Bangle.showClock();
else {
@ -252,6 +252,10 @@
}
}
/**
* Vibrate the watch if vibration is enabled
*/
let buzz = config.disableVibration ? () => {} : Bangle.buzz;
Bangle.loadWidgets();
Bangle.drawWidgets();

View File

@ -3,6 +3,7 @@ var SETTINGS_FILE = "folderlaunch.json";
var DEFAULT_CONFIG = {
showClocks: false,
showLaunchers: false,
disableVibration: false,
hidden: [],
display: {
rows: 2,

View File

@ -5,6 +5,7 @@ const SETTINGS_FILE: string = "folderlaunch.json";
const DEFAULT_CONFIG: Config = {
showClocks: false,
showLaunchers: false,
disableVibration: false,
hidden: [],
display: {
rows: 2,

View File

@ -1,7 +1,7 @@
{
"id": "folderlaunch",
"name": "Folder launcher",
"version": "0.02",
"version": "0.03",
"description": "Launcher that allows you to put your apps into folders",
"icon": "icon.png",
"type": "launch",

View File

@ -23,7 +23,6 @@
var appInfo = storage.readJSON(app_1 + '.info', false);
menu[appInfo.name] = {
value: config.hidden.includes(app_1),
format: function (value) { return (value ? 'Yes' : 'No'); },
onchange: eval("(value) => { onchange(value, \"".concat(app_1, "\"); }"))
};
}
@ -180,21 +179,26 @@
}
},
'Show clocks': {
value: config.showClocks,
format: function (value) { return (value ? 'Yes' : 'No'); },
value: !!config.showClocks,
onchange: function (value) {
config.showClocks = value;
changed = true;
}
},
'Show launchers': {
value: config.showLaunchers,
format: function (value) { return (value ? 'Yes' : 'No'); },
value: !!config.showLaunchers,
onchange: function (value) {
config.showLaunchers = value;
changed = true;
}
},
'Disable vibration': {
value: !!config.disableVibration,
onchange: function (value) {
config.disableVibration = value;
changed = true;
}
},
'Hidden apps': hiddenAppsMenu,
'Display': function () {
E.showMenu({
@ -212,7 +216,6 @@
},
'Show icons?': {
value: config.display.icon,
format: function (value) { return (value ? 'Yes' : 'No'); },
onchange: function (value) {
config.display.icon = value;
changed = true;

View File

@ -27,7 +27,6 @@
let appInfo = storage.readJSON(app + '.info', false) as AppInfo;
menu[appInfo.name] = {
value: config.hidden.includes(app),
format: (value: boolean) => (value ? 'Yes' : 'No'),
onchange: eval(`(value) => { onchange(value, "${app}"); }`)
}
}
@ -196,21 +195,26 @@
}
},
'Show clocks': {
value: config.showClocks,
format: value => (value ? 'Yes' : 'No'),
onchange: value => {
value: !!config.showClocks,
onchange: (value: boolean) => {
config.showClocks = value;
changed = true;
}
},
'Show launchers': {
value: config.showLaunchers,
format: value => (value ? 'Yes' : 'No'),
onchange: value => {
value: !!config.showLaunchers,
onchange: (value: boolean) => {
config.showLaunchers = value;
changed = true;
}
},
'Disable vibration': {
value: !!config.disableVibration,
onchange: (value: boolean) => {
config.disableVibration = value;
changed = true;
}
},
'Hidden apps': hiddenAppsMenu,
'Display': () => {
E.showMenu({
@ -228,7 +232,6 @@
},
'Show icons?': {
value: config.display.icon,
format: value => (value ? 'Yes' : 'No'),
onchange: value => {
config.display.icon = value;
changed = true;

View File

@ -10,6 +10,7 @@ type FolderList = Array<string>;
type Config = {
showClocks: boolean, // Whether clocks are shown
showLaunchers: boolean, // Whether launchers are shown
disableVibration: boolean, // Whether vibration is disabled
hidden: Array<String>, // IDs of apps to explicitly hide
display: {
rows: number, // Display an X by X grid of apps