Merge branch 'master' into fix/run-resume

Conflicts:
	apps/runplus/ChangeLog
master
Rob Pilling 2025-04-23 08:16:00 +01:00
commit 2db2bff31f
3 changed files with 30 additions and 14 deletions

View File

@ -29,5 +29,7 @@ Write to correct settings file, fixing settings not working.
0.26: Add ability to zoom in on a single stat by tapping it
0.27: Allow setting to alway resume an activity
0.28: Add vibration feedback on start/stop
0.29: Change the "time" stat to show active time (duration) rather than
0.29: Optimise UI: only redraw if we showed a recorder menu and correctly
track screen state
0.30: Change the "time" stat to show active time (duration) rather than
elapsed time (fix #3802)

View File

@ -90,14 +90,18 @@ function onStartStop() {
// an overwrite before we start tracking exstats
if (settings.record && WIDGETS["recorder"]) {
if (running) {
screen = "menu";
promise = promise.
then(() => WIDGETS["recorder"].setRecording(true, { force : shouldResume?"append":undefined })).
then(() => {
screen = "menu";
return WIDGETS["recorder"].setRecording(true, { force : shouldResume?"append":undefined });
}).then(() => {
screen = "main";
if(!shouldResume){
// setRecording might have rendered - need to grab UI
layout.setUI(); // grab our input handling again
layout.forgetLazyState();
layout.render();
}
});
} else {
promise = promise.then(
@ -146,7 +150,7 @@ function zoom(statID) {
.clearRect(R)
.setFontAlign(0, 0);
layout.render(layout.bottom);
tick();
const value = exs.state.active ? stat.getString() : "____";
@ -220,6 +224,20 @@ Bangle.on("GPS", function(fix) {
}
});
const tick = () => {
layout.clock.label = locale.time(new Date(),1);
switch (screen) {
case "main":
layout.render();
break;
case "zoom":
layout.render(layout.bottom);
break;
case "menu":
break;
}
};
function setScreen(to) {
if (screen === "karvonen") {
require("runplus_karvonen").stop();
@ -238,12 +256,8 @@ function setScreen(to) {
layout.render();
layout.lazy = true;
// We always call ourselves once a second to update
if (!runInterval){
runInterval = setInterval(function() {
layout.clock.label = locale.time(new Date(),1);
if (screen !== "menu") layout.render();
}, 1000);
}
if (!runInterval)
runInterval = setInterval(tick, 1000);
break;
case "karvonen":

View File

@ -1,7 +1,7 @@
{
"id": "runplus",
"name": "Run+",
"version": "0.29",
"version": "0.30",
"description": "Displays distance, time, steps, cadence, pace and more for runners. Based on the Run app, but extended with additional screens for heart rate interval training and individual stat focus.",
"icon": "app.png",
"tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen",