diff --git a/apps/c25k/ChangeLog b/apps/c25k/ChangeLog index 5560f00bc..4ef344621 100644 --- a/apps/c25k/ChangeLog +++ b/apps/c25k/ChangeLog @@ -1 +1,2 @@ 0.01: New App! +0.02: Add rep info to time screen diff --git a/apps/c25k/README.md b/apps/c25k/README.md index 8be8c2e15..8d523700f 100644 --- a/apps/c25k/README.md +++ b/apps/c25k/README.md @@ -55,6 +55,8 @@ For example `w6d1(r:6|w:3|x2)` means: If you ever need to peek at the time, just press the middle (or only) physical button on the watch: ![](c25k-scrn7.png) +This view also shows `current rep / total reps` at the top. + --- ## Disclaimer diff --git a/apps/c25k/app.js b/apps/c25k/app.js index bbc0c606e..2f80626f3 100644 --- a/apps/c25k/app.js +++ b/apps/c25k/app.js @@ -3,7 +3,8 @@ var day = 1; var time; var loop; // To store how many times we will have to do a countdown -var counter = 0; // To keep count of how many iterations we have in the current countdown +var rep = 0; // The current rep counter +var counter = 0; // The seconds counter var currentMode; // Either "run" or "walk" var mainInterval; // Ticks every second, checking if a new countdown is needed var activityInterval; // Ticks every second, doing the countdown @@ -31,21 +32,20 @@ function outOfTime() { } function countDown() { - text = (currentMode === "run") ? "Run\n" + counter : "Walk\n" + counter; // Switches output text + var text = ""; + var textsize = (process.env.HWVERSION == 2) ? 7 : 8; // Default font size, Banglejs 2 has smaller screen + if (time) { + var w = week -1; + var d = day - 1; + var total = ("walk" in PLAN[w][d]) ? PLAN[w][d].repetition : 1; + text += rep + "/" + total + "\n"; // Show the current/total rep count when time is shown + textsize -= (process.env.HWVERSION == 2) ? 2 : 1; // Use smaller font size to fit everything nicely on the screen + } + text += (currentMode === "run") ? "Run\n" + counter : "Walk\n" + counter; // Switches output text if (time) text += "\n" + time; g.clear(); - g.setFontAlign(0,0); // center font - if (process.env.HWVERSION == 2) { // To accomodate the Bangle.js 2 screen - if (time) { - g.setFont("6x8",5); // when time is shown - } - else { - g.setFont("6x8",7); // when time is not shown - } - } - else { - g.setFont("6x8",8); // bitmap font, 8x magnified - } + g.setFontAlign(0, 0); // center font + g.setFont("6x8", textsize); g.drawString(text, g.getWidth() / 2, g.getHeight() / 2); // draw the current mode and seconds Bangle.setLCDPower(1); // keep the watch LCD lit up @@ -69,6 +69,7 @@ function startTimer(w, d) { // Switches between the two modes if (!currentMode || currentMode === "walk") { currentMode = "run"; + rep++; // Increase the rep counter every time a "run" activity starts counter = PLAN[w][d].run * 60; g.setBgColor("#ff5733"); } diff --git a/apps/c25k/c25k-scrn7.png b/apps/c25k/c25k-scrn7.png index 9fc8ebd3c..407afd48b 100644 Binary files a/apps/c25k/c25k-scrn7.png and b/apps/c25k/c25k-scrn7.png differ diff --git a/apps/c25k/metadata.json b/apps/c25k/metadata.json index 87ee2681b..da3d061c6 100644 --- a/apps/c25k/metadata.json +++ b/apps/c25k/metadata.json @@ -2,7 +2,7 @@ "id": "c25k", "name": "C25K", "icon": "app.png", - "version":"0.01", + "version":"0.02", "description": "Unofficial app for the Couch to 5k training plan", "readme": "README.md", "type": "app",