Renamed bgtimer to keytimer

pull/2217/head
Bruce Blore 2022-11-05 21:05:47 -07:00
parent 5e525f081f
commit 2216f3fb19
15 changed files with 31 additions and 31 deletions

View File

@ -1,11 +0,0 @@
const BGTIMER_common = require("bgtimer-com.js");
//Only start the timeout if the timer is running
if (BGTIMER_common.state.running) {
setTimeout(() => {
//Check now to avoid race condition
if (Bangle.BGTIMER_ACTIVE === undefined) {
load('bgtimer-ring.js');
}
}, BGTIMER_common.getTimeLeft());
}

View File

@ -40,7 +40,7 @@ let config = Object.assign({
// false = no shortcut // false = no shortcut
// '#LAUNCHER' = open the launcher // '#LAUNCHER' = open the launcher
// any other string = name of app to open // any other string = name of app to open
'stlap', 'bgtimer', 'pomoplus', 'alarm', 'stlap', 'keytimer', 'pomoplus', 'alarm',
'rpnsci', 'calendar', 'torch', 'weather' 'rpnsci', 'calendar', 'torch', 'weather'
], ],

View File

@ -37,7 +37,7 @@
// false = no shortcut // false = no shortcut
// '#LAUNCHER' = open the launcher // '#LAUNCHER' = open the launcher
// any other string = name of app to open // any other string = name of app to open
'stlap', 'bgtimer', 'pomoplus', 'alarm', 'stlap', 'keytimer', 'pomoplus', 'alarm',
'rpnsci', 'calendar', 'torch', 'weather' 'rpnsci', 'calendar', 'torch', 'weather'
], ],

View File

@ -1,9 +1,9 @@
Bangle.BGTIMER_ACTIVE = true; Bangle.keytimer_ACTIVE = true;
const common = require("bgtimer-com.js"); const common = require("keytimer-com.js");
const storage = require("Storage"); const storage = require("Storage");
const keypad = require("bgtimer-keys.js"); const keypad = require("keytimer-keys.js");
const timerView = require("bgtimer-tview.js"); const timerView = require("keytimer-tview.js");
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();

11
apps/keytimer/boot.js Normal file
View File

@ -0,0 +1,11 @@
const keytimer_common = require("keytimer-com.js");
//Only start the timeout if the timer is running
if (keytimer_common.state.running) {
setTimeout(() => {
//Check now to avoid race condition
if (Bangle.keytimer_ACTIVE === undefined) {
load('keytimer-ring.js');
}
}, keytimer_common.getTimeLeft());
}

View File

@ -1,7 +1,7 @@
const storage = require("Storage"); const storage = require("Storage");
const heatshrink = require("heatshrink"); const heatshrink = require("heatshrink");
exports.STATE_PATH = "bgtimer.state.json"; exports.STATE_PATH = "keytimer.state.json";
exports.BUTTON_ICONS = { exports.BUTTON_ICONS = {
play: heatshrink.decompress(atob("jEYwMAkAGBnACBnwCBn+AAQPgAQPwAQP8AQP/AQXAAQPwAQP8AQP+AQgICBwQUCEAn4FggyBHAQ+CIgQ")), play: heatshrink.decompress(atob("jEYwMAkAGBnACBnwCBn+AAQPgAQPwAQP8AQP/AQXAAQPwAQP8AQP+AQgICBwQUCEAn4FggyBHAQ+CIgQ")),

View File

Before

Width:  |  Height:  |  Size: 414 B

After

Width:  |  Height:  |  Size: 414 B

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -58,7 +58,7 @@ let StartButton = {
common.state.wasRunning = true; common.state.wasRunning = true;
common.state.running = true; common.state.running = true;
feedback(true); feedback(true);
require('bgtimer-tview.js').show(common); require('keytimer-tview.js').show(common);
} }
}; };

View File

@ -1,6 +1,6 @@
{ {
"id": "bgtimer", "id": "keytimer",
"name": "Timer", "name": "Keypad Timer",
"version": "0.02", "version": "0.02",
"description": "A timer with a keypad that runs in the background", "description": "A timer with a keypad that runs in the background",
"icon": "icon.png", "icon": "icon.png",
@ -12,32 +12,32 @@
"allow_emulator": true, "allow_emulator": true,
"storage": [ "storage": [
{ {
"name": "bgtimer.app.js", "name": "keytimer.app.js",
"url": "app.js" "url": "app.js"
}, },
{ {
"name": "bgtimer.img", "name": "keytimer.img",
"url": "icon.js", "url": "icon.js",
"evaluate": true "evaluate": true
}, },
{ {
"name": "bgtimer.boot.js", "name": "keytimer.boot.js",
"url": "boot.js" "url": "boot.js"
}, },
{ {
"name": "bgtimer-com.js", "name": "keytimer-com.js",
"url": "common.js" "url": "common.js"
}, },
{ {
"name": "bgtimer-ring.js", "name": "keytimer-ring.js",
"url": "ring.js" "url": "ring.js"
}, },
{ {
"name": "bgtimer-keys.js", "name": "keytimer-keys.js",
"url": "keypad.js" "url": "keypad.js"
}, },
{ {
"name": "bgtimer-tview.js", "name": "keytimer-tview.js",
"url": "timerview.js" "url": "timerview.js"
} }
] ]

View File

@ -1,4 +1,4 @@
const common = require('bgtimer-com.js'); const common = require('keytimer-com.js');
Bangle.loadWidgets() Bangle.loadWidgets()
Bangle.drawWidgets() Bangle.drawWidgets()

View File

@ -39,7 +39,7 @@ function drawTimer() {
else return `${parseInt(minutes)}:${pad(seconds)}`; else return `${parseInt(minutes)}:${pad(seconds)}`;
})(), g.getWidth() / 2, g.getHeight() / 2) })(), g.getWidth() / 2, g.getHeight() / 2)
if (timeLeft <= 0) load('bgtimer-ring.js'); if (timeLeft <= 0) load('keytimer-ring.js');
} }
let timerInterval; let timerInterval;
@ -81,7 +81,7 @@ exports.touch = (button, xy) => {
common.state.setTime = setTime; common.state.setTime = setTime;
common.state.inputString = inputString; common.state.inputString = inputString;
clearTimerInterval(); clearTimerInterval();
require('bgtimer-keys.js').show(common); require('keytimer-keys.js').show(common);
} else { } else {
if (common.state.running) { if (common.state.running) {
//Record the exact moment that we paused //Record the exact moment that we paused