Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/runplus/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ Write to correct settings file, fixing settings not working.
track screen state
0.30: Change the "time" stat to show active time (duration) rather than
elapsed time (fix #3802), and sync with recorder on load
0.31: Add setting to show GPS strength bar on the left
6 changes: 4 additions & 2 deletions apps/runplus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Displays distance, time, steps, cadence, pace and heart rate for runners. Based
It requires the input of your minimum and maximum heart rate in the settings for the app to work. You can come back to the initial run screen anytime by swiping left.
To use it, start the app and press the middle button so that the red STOP in the bottom right turns to a green `RUN`.

To focus on a single stat, tap on the stat and it will take up the full screen. Tap again to return to the main screen.

## Display 1st screen

* `DIST` - the distance travelled based on the GPS (if you have a GPS lock).
Expand All @@ -23,6 +21,8 @@ so if you have no GPS lock you just need to wait.
* The current time is displayed right at the bottom of the screen
* `RUN/STOP` - whether the distance for your run is being displayed or not

To focus on a single stat, tap on the stat and it will take up the full screen. Tap again to return to the main screen.

## Display 2nd screen

Unlock the screen and navigate between displays by swiping left or right.
Expand Down Expand Up @@ -75,10 +75,12 @@ app loader, the module is automatically included in the app's source. However
when developing via the IDE the module won't get pulled in by default.

There are some options to fix this easily - please check out the [modules README.md file](https://github.com/espruino/BangleApps/blob/master/modules/README.md)

## Contributors (Run and Run+)
gfwilliams
hughbarney
GrandVizierOlaf
BartS23
f-teacher
thyttan
bobrippling
46 changes: 43 additions & 3 deletions apps/runplus/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ let settings = Object.assign({
paceLength: 1000,
alwaysResume: false,
vibrate: false,
showSats: false,
notify: {
dist: {
value: 0,
Expand Down Expand Up @@ -197,9 +198,48 @@ lc.push({ type:"h", id:"bottom", filly:1, c:[
{type:"txt", font:fontHeading, label:"---", id:"status", fillx:1 }
]});
// Now calculate the layout
let layout = new Layout( {
type:"v", c: lc
},{lazy:true, btns:[{ label:"---", cb: onStartStop, id:"button"}]});
let topLevel = { type:"v", c: lc };
if(settings.showSats){
const drawGpsLvl = l => {
const gps = l.gps;
const nsats = gps && gps.satellites || 0;

if (!gps || !gps.fix)
g.setColor("#FF0000");
else if (nsats < 4)
g.setColor("#FF5500");
else if (nsats < 6)
g.setColor("#FF8800");
else if (nsats < 8)
g.setColor("#FFCC00");
else
g.setColor("#00FF00");

g.fillRect(
l.x,
l.y + l.h - 10 - (l.h - 10) * ((nsats > 12 ? 12 : nsats) / 12),
l.x + l.w - 1,
l.y + l.h - 1
);
};

topLevel = {
type: "h",
c: [
{
type: "custom",
render: drawGpsLvl,
id: "gpslvl",
filly: 1,
width: 5,
bgCol: g.theme.bg, // automatically clears before render()
},
topLevel,
]
}
}
let layout = new Layout(topLevel, {lazy:true, btns:[{ label:"---", cb: onStartStop, id:"button"}]});
delete topLevel;
delete lc;
setStatus(exs.state.active);
layout.render();
Expand Down
2 changes: 1 addition & 1 deletion apps/runplus/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "runplus",
"name": "Run+",
"version": "0.30",
"version": "0.31",
"author": "thyttan",
"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",
Expand Down
8 changes: 8 additions & 0 deletions apps/runplus/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
paceLength: 1000, // TODO: Default to either 1km or 1mi based on locale
alwaysResume: false,
vibrate: false,
showSats: false,
notify: {
dist: {
increment: 0,
Expand Down Expand Up @@ -88,6 +89,13 @@
saveSettings();
},
};
menu[/*LANG*/"Show satelite bar"] = {
value : settings.showSats,
onchange : v => {
settings.showSats = v;
saveSettings();
},
};
var notificationsMenu = {
'< Back': function() { E.showMenu(menu) },
}
Expand Down