diff --git a/apps/chess/ChangeLog b/apps/chess/ChangeLog index 1fb70549c..516bcb055 100644 --- a/apps/chess/ChangeLog +++ b/apps/chess/ChangeLog @@ -3,3 +3,4 @@ 0.03: Use Bangle.setBacklight() 0.04: Add option to buzz after computer move 0.05: Minor code improvements +0.06: Use button rising edge for Menu diff --git a/apps/chess/app.js b/apps/chess/app.js index 19802083d..69c49836d 100644 --- a/apps/chess/app.js +++ b/apps/chess/app.js @@ -306,4 +306,4 @@ setWatch(() => { } }, }); -}, BTN, { repeat: true, edge: "falling" }); +}, BTN, { repeat: true, edge: "rising" }); diff --git a/apps/chess/metadata.json b/apps/chess/metadata.json index 4f810886b..1e2885392 100644 --- a/apps/chess/metadata.json +++ b/apps/chess/metadata.json @@ -2,7 +2,7 @@ "id": "chess", "name": "Chess", "shortName": "Chess", - "version": "0.05", + "version": "0.06", "description": "Chess game based on the [p4wn engine](https://p4wn.sourceforge.net/). Drag on the touchscreen to move the green cursor onto a piece, select it with a single touch and drag the now red cursor around. Release the piece with another touch to finish the move. The button opens a menu.", "icon": "app.png", "tags": "game", diff --git a/apps/gipy/ChangeLog b/apps/gipy/ChangeLog index b0445c161..17a701de4 100644 --- a/apps/gipy/ChangeLog +++ b/apps/gipy/ChangeLog @@ -141,3 +141,5 @@ 0.26: Add option to plot openstmap if installed 0.27: Support for large paths (grid sizes > 65k) + +0.28: Avoid crash on negative array access diff --git a/apps/gipy/app.js b/apps/gipy/app.js index 659e12d98..7127ab132 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -34,6 +34,7 @@ var settings = Object.assign( power_lcd_off: false, powersave_by_default: false, sleep_between_waypoints: false, + keep_gps_alive: true }, s.readJSON("gipy.json", true) || {} ); @@ -255,6 +256,7 @@ class Map { add_to_tile_image(img, absolute_tile_x, absolute_tile_y) { let tile_x = absolute_tile_x - this.first_tile[0]; let tile_y = absolute_tile_y - this.first_tile[1]; + if (tile_x < 0 || tile_y < 0) return; // FIXME: Negative Array index let side = img.getWidth() - 6; let thick = this.color[0] == 1; @@ -609,16 +611,16 @@ class Status { ); // disable gps when far from next point and locked - // if (Bangle.isLocked() && !settings.keep_gps_alive) { - // let time_to_next_point = - // (this.distance_to_next_point * 3.6) / settings.max_speed; - // if (time_to_next_point > 60) { - // Bangle.setGPSPower(false, "gipy"); - // setTimeout(function () { - // Bangle.setGPSPower(true, "gipy"); - // }, time_to_next_point); - // } - // } + if (Bangle.isLocked() && !settings.keep_gps_alive) { + let time_to_next_point = + (this.distance_to_next_point * 3.6) / settings.max_speed; + if (time_to_next_point > 60) { + Bangle.setGPSPower(false, "gipy"); + setTimeout(function () { + Bangle.setGPSPower(true, "gipy"); + }, time_to_next_point); + } + } let reaching_waypoint = this.path.is_waypoint(next_point); if (this.distance_to_next_point <= 100) { if (reaching_waypoint || !settings.sleep_between_waypoints) { diff --git a/apps/gipy/metadata.json b/apps/gipy/metadata.json index 91e371c16..04ff05caf 100644 --- a/apps/gipy/metadata.json +++ b/apps/gipy/metadata.json @@ -2,7 +2,7 @@ "id": "gipy", "name": "Gipy", "shortName": "Gipy", - "version": "0.27", + "version": "0.28", "description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.", "allow_emulator":false, "icon": "gipy.png", diff --git a/apps/gipy/settings.js b/apps/gipy/settings.js index 9562bc3c1..ccc129ce5 100644 --- a/apps/gipy/settings.js +++ b/apps/gipy/settings.js @@ -11,6 +11,7 @@ power_lcd_off: false, powersave_by_default: false, sleep_between_waypoints: false, + keep_gps_alive: true }, require("Storage").readJSON(FILE, true) || {} ); @@ -97,6 +98,13 @@ settings.sleep_between_waypoints = v; writeSettings(); } - } + }, + "keep gps alive": { + value: !!settings.keep_gps_alive, // !! converts undefined to false + onchange: (v) => { + settings.keep_gps_alive = v; + writeSettings(); + }, + }, }); }) diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index cf1bfaa98..321c07be0 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -115,4 +115,5 @@ 0.84: Fix: Assign show message entry to the settings menu and not the message itself. 0.85: Use new Rebble fonts if available Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now -0.86: Default to showing message scroller (with title, bigger icon) \ No newline at end of file +0.86: Default to showing message scroller (with title, bigger icon) +0.87: Make choosing of font size more repeatable diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index c9643234e..d47a43d65 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -355,6 +355,9 @@ function showMessage(msgid, persist) { cancelReloadTimeout(); // don't auto-reload to clock now return showMapMessage(msg); } + // remove widgets here as we need to check the height when choosing a font + Bangle.setUI(); // force last UI to be removed (will call require("widget_utils").show(); if last displaying a message) + if (!settings.showWidgets) require("widget_utils").hide(); active = "message"; // Normal text message display let src=msg.src||/*LANG*/"Message", srcFont = fontSmall; @@ -380,7 +383,7 @@ function showMessage(msgid, persist) { } } if (body) { // Try and find a font that fits... - let w = g.getWidth()-2, h = Bangle.appRect.h-60; + let w = g.getWidth()-2, h = Bangle.appRect.h-80; if (g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) { bodyFont = fontBig; if (settings.fontSize!=1 && g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) { @@ -439,8 +442,6 @@ function showMessage(msgid, persist) { let textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0)); let msgIcon = require("messageicons").getImage(msg); let msgCol = require("messageicons").getColor(msg, {settings, default:g.theme.fg2}); - Bangle.setUI(); // force last UI to be removed (will call require("widget_utils").show(); if last displaying a message) - if (!settings.showWidgets) require("widget_utils").hide(); let scroller = E.showScroller({ h : rowHeight, // height of each menu item in pixels c : Math.ceil((lines.length-textLineOffset) / linesPerRow), // number of menu items @@ -647,4 +648,4 @@ as a queue to stop repeated buzzing */ Bangle.on('lock',locked => { if (!locked) require("messages").stopBuzz(); -}); \ No newline at end of file +}); diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 1f804ad56..d2a2704c7 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.86", + "version": "0.87", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", diff --git a/apps/widbgjs/README.md b/apps/widbgjs/README.md index 23a37fa33..274160543 100644 --- a/apps/widbgjs/README.md +++ b/apps/widbgjs/README.md @@ -3,6 +3,7 @@ For this widget to work and to get data from the phone, you need: - An Android phone - with xDrip and the helper app installed. - the Gadgetbridge app (bangle version) for the Android phone + - Gadgetbridge `Allow Intents` setting enabled (click on the gear icon in the Bangle.js device's card, and scroll down) - A BangleJS - With this widget installed