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
// '#LAUNCHER' = open the launcher
// any other string = name of app to open
'stlap', 'bgtimer', 'pomoplus', 'alarm',
'stlap', 'keytimer', 'pomoplus', 'alarm',
'rpnsci', 'calendar', 'torch', 'weather'
],

View File

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

View File

@ -1,9 +1,9 @@
Bangle.BGTIMER_ACTIVE = true;
const common = require("bgtimer-com.js");
Bangle.keytimer_ACTIVE = true;
const common = require("keytimer-com.js");
const storage = require("Storage");
const keypad = require("bgtimer-keys.js");
const timerView = require("bgtimer-tview.js");
const keypad = require("keytimer-keys.js");
const timerView = require("keytimer-tview.js");
Bangle.loadWidgets();
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 heatshrink = require("heatshrink");
exports.STATE_PATH = "bgtimer.state.json";
exports.STATE_PATH = "keytimer.state.json";
exports.BUTTON_ICONS = {
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.running = true;
feedback(true);
require('bgtimer-tview.js').show(common);
require('keytimer-tview.js').show(common);
}
};

View File

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

View File

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