Merge branch 'espruino:master' into feat/timer-widget

master
Leon Weber-Genzel 2025-06-02 14:15:52 +02:00 committed by GitHub
commit d4e534be37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 36 additions and 20 deletions

View File

@ -3,3 +3,4 @@
0.03: Use Bangle.setBacklight() 0.03: Use Bangle.setBacklight()
0.04: Add option to buzz after computer move 0.04: Add option to buzz after computer move
0.05: Minor code improvements 0.05: Minor code improvements
0.06: Use button rising edge for Menu

View File

@ -306,4 +306,4 @@ setWatch(() => {
} }
}, },
}); });
}, BTN, { repeat: true, edge: "falling" }); }, BTN, { repeat: true, edge: "rising" });

View File

@ -2,7 +2,7 @@
"id": "chess", "id": "chess",
"name": "Chess", "name": "Chess",
"shortName": "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.", "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", "icon": "app.png",
"tags": "game", "tags": "game",

View File

@ -141,3 +141,5 @@
0.26: Add option to plot openstmap if installed 0.26: Add option to plot openstmap if installed
0.27: Support for large paths (grid sizes > 65k) 0.27: Support for large paths (grid sizes > 65k)
0.28: Avoid crash on negative array access

View File

@ -34,6 +34,7 @@ var settings = Object.assign(
power_lcd_off: false, power_lcd_off: false,
powersave_by_default: false, powersave_by_default: false,
sleep_between_waypoints: false, sleep_between_waypoints: false,
keep_gps_alive: true
}, },
s.readJSON("gipy.json", true) || {} s.readJSON("gipy.json", true) || {}
); );
@ -255,6 +256,7 @@ class Map {
add_to_tile_image(img, absolute_tile_x, absolute_tile_y) { add_to_tile_image(img, absolute_tile_x, absolute_tile_y) {
let tile_x = absolute_tile_x - this.first_tile[0]; let tile_x = absolute_tile_x - this.first_tile[0];
let tile_y = absolute_tile_y - this.first_tile[1]; 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 side = img.getWidth() - 6;
let thick = this.color[0] == 1; let thick = this.color[0] == 1;
@ -609,16 +611,16 @@ class Status {
); );
// disable gps when far from next point and locked // disable gps when far from next point and locked
// if (Bangle.isLocked() && !settings.keep_gps_alive) { if (Bangle.isLocked() && !settings.keep_gps_alive) {
// let time_to_next_point = let time_to_next_point =
// (this.distance_to_next_point * 3.6) / settings.max_speed; (this.distance_to_next_point * 3.6) / settings.max_speed;
// if (time_to_next_point > 60) { if (time_to_next_point > 60) {
// Bangle.setGPSPower(false, "gipy"); Bangle.setGPSPower(false, "gipy");
// setTimeout(function () { setTimeout(function () {
// Bangle.setGPSPower(true, "gipy"); Bangle.setGPSPower(true, "gipy");
// }, time_to_next_point); }, time_to_next_point);
// } }
// } }
let reaching_waypoint = this.path.is_waypoint(next_point); let reaching_waypoint = this.path.is_waypoint(next_point);
if (this.distance_to_next_point <= 100) { if (this.distance_to_next_point <= 100) {
if (reaching_waypoint || !settings.sleep_between_waypoints) { if (reaching_waypoint || !settings.sleep_between_waypoints) {

View File

@ -2,7 +2,7 @@
"id": "gipy", "id": "gipy",
"name": "Gipy", "name": "Gipy",
"shortName": "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.", "description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.",
"allow_emulator":false, "allow_emulator":false,
"icon": "gipy.png", "icon": "gipy.png",

View File

@ -11,6 +11,7 @@
power_lcd_off: false, power_lcd_off: false,
powersave_by_default: false, powersave_by_default: false,
sleep_between_waypoints: false, sleep_between_waypoints: false,
keep_gps_alive: true
}, },
require("Storage").readJSON(FILE, true) || {} require("Storage").readJSON(FILE, true) || {}
); );
@ -97,6 +98,13 @@
settings.sleep_between_waypoints = v; settings.sleep_between_waypoints = v;
writeSettings(); writeSettings();
} }
} },
"keep gps alive": {
value: !!settings.keep_gps_alive, // !! converts undefined to false
onchange: (v) => {
settings.keep_gps_alive = v;
writeSettings();
},
},
}); });
}) })

View File

@ -115,4 +115,5 @@
0.84: Fix: Assign show message entry to the settings menu and not the message itself. 0.84: Fix: Assign show message entry to the settings menu and not the message itself.
0.85: Use new Rebble fonts if available 0.85: Use new Rebble fonts if available
Remove workaround for 2v10 (>3 years ago) - assume everyone is on never firmware now 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) 0.86: Default to showing message scroller (with title, bigger icon)
0.87: Make choosing of font size more repeatable

View File

@ -355,6 +355,9 @@ function showMessage(msgid, persist) {
cancelReloadTimeout(); // don't auto-reload to clock now cancelReloadTimeout(); // don't auto-reload to clock now
return showMapMessage(msg); 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"; active = "message";
// Normal text message display // Normal text message display
let src=msg.src||/*LANG*/"Message", srcFont = fontSmall; 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... 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) { if (g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) {
bodyFont = fontBig; bodyFont = fontBig;
if (settings.fontSize!=1 && g.setFont(bodyFont).wrapString(body, w).length*g.getFontHeight() > h) { 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 textLineOffset = -(linesPerRow + ((rowLeftDraw||rowRightDraw)?1:0));
let msgIcon = require("messageicons").getImage(msg); let msgIcon = require("messageicons").getImage(msg);
let msgCol = require("messageicons").getColor(msg, {settings, default:g.theme.fg2}); 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({ let scroller = E.showScroller({
h : rowHeight, // height of each menu item in pixels h : rowHeight, // height of each menu item in pixels
c : Math.ceil((lines.length-textLineOffset) / linesPerRow), // number of menu items 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 => { Bangle.on('lock',locked => {
if (!locked) if (!locked)
require("messages").stopBuzz(); require("messages").stopBuzz();
}); });

View File

@ -2,7 +2,7 @@
"id": "messagegui", "id": "messagegui",
"name": "Message UI", "name": "Message UI",
"shortName": "Messages", "shortName": "Messages",
"version": "0.86", "version": "0.87",
"description": "Default app to display notifications from iOS and Gadgetbridge/Android", "description": "Default app to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",

View File

@ -3,6 +3,7 @@ For this widget to work and to get data from the phone, you need:
- An Android phone - An Android phone
- with xDrip and the <a href="https://codeberg.org/phrogg/BG2BangleJSApp/" target="_BLANK">helper app</a> installed. - with xDrip and the <a href="https://codeberg.org/phrogg/BG2BangleJSApp/" target="_BLANK">helper app</a> installed.
- the <a href="https://f-droid.org/en/packages/com.espruino.gadgetbridge.banglejs/" target="_BLANK">Gadgetbridge app (bangle version)</a> for the Android phone - the <a href="https://f-droid.org/en/packages/com.espruino.gadgetbridge.banglejs/" target="_BLANK">Gadgetbridge app (bangle version)</a> 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 - A BangleJS
- With this widget installed - With this widget installed