From 21d6c8846c18bebf576d89b1960fe511b8ef7661 Mon Sep 17 00:00:00 2001 From: dapgo Date: Sun, 7 May 2023 13:16:09 +0200 Subject: [PATCH] Cosmetic and UX improvements IMO the UX and legibility have been improved --- apps/wohrm/ChangeLog | 1 + apps/wohrm/README.md | 6 ++++ apps/wohrm/app.js | 28 ++++++++++-------- apps/wohrm/bangle2-workout-HRM-screenshot.png | Bin 0 -> 2437 bytes apps/wohrm/metadata.json | 2 +- 5 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 apps/wohrm/bangle2-workout-HRM-screenshot.png diff --git a/apps/wohrm/ChangeLog b/apps/wohrm/ChangeLog index 2ca405365..8cdb24153 100644 --- a/apps/wohrm/ChangeLog +++ b/apps/wohrm/ChangeLog @@ -9,3 +9,4 @@ 0.09: Ported to Bangle.js2 Home returns to clock, instead of menu Add settings +0.10: Increased(font sizes and bg height for current HR), BJS2 (added support for bottom widgets) diff --git a/apps/wohrm/README.md b/apps/wohrm/README.md index 87b1a65da..d35feb253 100644 --- a/apps/wohrm/README.md +++ b/apps/wohrm/README.md @@ -30,3 +30,9 @@ Pressing middle button will switch off the HRM of the watch and return you to th # HRM usage The HRM is switched on when the app is started. It stays switch on while the app is running, even when the watch screen goes to stand-by. + + +Screenshot BJS2 emul + +![](bangle2-workout-HRM-screenshot.png) + diff --git a/apps/wohrm/app.js b/apps/wohrm/app.js index ab579463c..4b7ab7fc6 100644 --- a/apps/wohrm/app.js +++ b/apps/wohrm/app.js @@ -18,7 +18,7 @@ let lowerLimitChanged = true; let limitSetter = Setter.NONE; -let currentHeartRate = 0; +let currentHeartRate = 0; //use for emuls let hrConfidence = -1; let hrChanged = true; let confidenceChanged = true; @@ -31,7 +31,7 @@ const upperLshape = isB1 ? { left: 210, bottom: 40, top: 210, - rectWidth: 30, + rectWidth: 30, cornerRoundness: 5, orientation: -1, color: '#f00' @@ -39,7 +39,7 @@ const upperLshape = isB1 ? { right: Bangle.appRect.x2-100, left: Bangle.appRect.x2, bottom: 24, - top: Bangle.appRect.y2, + top: Bangle.appRect.y2-24, //for bottom widget rectWidth: 26, cornerRoundness: 4, orientation: -1, // rotated 180° @@ -58,19 +58,20 @@ const lowerLshape = { }; const centerBar = { - minY: (upperLshape.bottom + upperLshape.top - upperLshape.rectWidth)/2, - maxY: (upperLshape.bottom + upperLshape.top + upperLshape.rectWidth)/2, + //1.5 =height*2 + minY: (upperLshape.bottom + upperLshape.top - (upperLshape.rectWidth*1.5))/2, + maxY: (upperLshape.bottom + upperLshape.top + (upperLshape.rectWidth*1.5))/2, confidenceWidth: isB1 ? 10 : 8, - minX: isB1 ? 55 : upperLshape.rectWidth + 14, + minX: isB1 ? 55 : upperLshape.rectWidth + 14, maxX: isB1 ? 165 : Bangle.appRect.x2 - upperLshape.rectWidth - 14 }; const fontSizes = isB1 ? { - limits: 13, - heartRate: 24 + limits: 14, + heartRate: 44 } : { - limits: 12, - heartRate: 20 + limits: 16, + heartRate: 34 }; function fillEllipse(x, y, x2, y2) { @@ -178,10 +179,11 @@ function renderCurrentHeartRate() { g.setColor(g.theme.bg); g.setFontVector(fontSizes.heartRate); - g.setFontAlign(1, 0, 0); + g.setFontAlign(0, 0, 0);//center g.drawString(currentHeartRate, - Math.max(upperLshape.right+upperLshape.cornerRoundness, - lowerLshape.right-lowerLshape.cornerRoundness), + // Math.max(upperLshape.right+upperLshape.cornerRoundness, lowerLshape.right-lowerLshape.cornerRoundness), + // Math.max(upperLshape.right+upperLshape.cornerRoundness, lowerLshape.right-lowerLshape.cornerRoundness)-(g.stringWidth(currentHeartRate)/2), + centerBar.minX+((centerBar.maxX-centerBar.minX)/2), (centerBar.minY+centerBar.maxY)/2); //Reset alignment to defaults diff --git a/apps/wohrm/bangle2-workout-HRM-screenshot.png b/apps/wohrm/bangle2-workout-HRM-screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..b75c1b12c842ea9cb3afd74d3243b62c5899d931 GIT binary patch literal 2437 zcmb_e`#aS67k__7GvhMkHcT$#mSSW_i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