Merge branch 'feat/timer-widget' of github.com:leonweber/BangleApps into feat/timer-widget
commit
1e864132a1
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -306,4 +306,4 @@ setWatch(() => {
|
|||
}
|
||||
},
|
||||
});
|
||||
}, BTN, { repeat: true, edge: "falling" });
|
||||
}, BTN, { repeat: true, edge: "rising" });
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
0.86: Default to showing message scroller (with title, bigger icon)
|
||||
0.87: Make choosing of font size more repeatable
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 <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
|
||||
- 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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue