diff --git a/apps/alarm/ChangeLog b/apps/alarm/ChangeLog index a41167e7641..b2cd6cf16f0 100644 --- a/apps/alarm/ChangeLog +++ b/apps/alarm/ChangeLog @@ -47,3 +47,4 @@ 0.42: Fix date not getting saved in event edit menu when tapping Confirm 0.43: New settings: Show confirm, Show Overflow, Show Type. 0.44: Add "delete timer after expiration" setting to events. +0.45: Fix new alarm when selectedAlarm is undefined diff --git a/apps/alarm/app.js b/apps/alarm/app.js index 52dbe40fd86..54cdbd30910 100644 --- a/apps/alarm/app.js +++ b/apps/alarm/app.js @@ -106,7 +106,7 @@ function showEditAlarmMenu(selectedAlarm, alarmIndex, withDate) { var isNew = alarmIndex === undefined; var alarm = require("sched").newDefaultAlarm(); - if (withDate || selectedAlarm.date) { + if (withDate || (selectedAlarm && selectedAlarm.date)) { alarm.del = require("sched").getSettings().defaultDeleteExpiredTimers; } alarm.dow = handleFirstDayOfWeek(alarm.dow); diff --git a/apps/alarm/metadata.json b/apps/alarm/metadata.json index 31a3e5bf0b6..680c5b7bd82 100644 --- a/apps/alarm/metadata.json +++ b/apps/alarm/metadata.json @@ -2,7 +2,7 @@ "id": "alarm", "name": "Alarms & Timers", "shortName": "Alarms", - "version": "0.44", + "version": "0.45", "description": "Set alarms and timers on your Bangle", "icon": "app.png", "tags": "tool,alarm", diff --git a/apps/gpsnav/metadata.json b/apps/gpsnav/metadata.json index bc46a733cc4..01092f1c198 100644 --- a/apps/gpsnav/metadata.json +++ b/apps/gpsnav/metadata.json @@ -8,7 +8,7 @@ "tags": "tool,outdoors,gps", "supports": ["BANGLEJS","BANGLEJS2"], "readme": "README.md", - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "storage": [ {"name":"gpsnav.app.js","url":"app.min.js","supports":["BANGLEJS"]}, {"name":"gpsnav.app.js","url":"app_b2.js","supports":["BANGLEJS2"]}, diff --git a/apps/gpstrek/metadata.json b/apps/gpstrek/metadata.json index ec953e6e710..79136000112 100644 --- a/apps/gpstrek/metadata.json +++ b/apps/gpstrek/metadata.json @@ -8,7 +8,7 @@ "tags": "tool,outdoors,gps", "supports": ["BANGLEJS2"], "readme": "README.md", - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "interface" : "interface.html", "storage": [ {"name":"gpstrek.app.js","url":"app.js"}, diff --git a/apps/kitchen/metadata.json b/apps/kitchen/metadata.json index 9c9f7b2ecdc..b084fa1573b 100644 --- a/apps/kitchen/metadata.json +++ b/apps/kitchen/metadata.json @@ -8,7 +8,7 @@ "tags": "tool,outdoors,gps", "supports": ["BANGLEJS"], "readme": "README.md", - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "storage": [ {"name":"kitchen.app.js","url":"kitchen.app.js"}, {"name":"stepo2.kit.js","url":"stepo2.kit.js"}, diff --git a/apps/messagegui/ChangeLog b/apps/messagegui/ChangeLog index 4fe0584d205..ea6b0fe43d9 100644 --- a/apps/messagegui/ChangeLog +++ b/apps/messagegui/ChangeLog @@ -100,4 +100,5 @@ On 2v18.64+ firmware, 'No Messages' now has a 'back' button 0.72: Nav message updastes don't automatically launch navigation menu unless they're new 0.73: Add sharp left+right nav icons -0.74: Add option for driving on left (affects roundabout icons in navigation) \ No newline at end of file +0.74: Add option for driving on left (affects roundabout icons in navigation) +0.75: Handle text with images in messages list by just displaying the first line \ No newline at end of file diff --git a/apps/messagegui/app.js b/apps/messagegui/app.js index 7aa4d432af3..5596510c577 100644 --- a/apps/messagegui/app.js +++ b/apps/messagegui/app.js @@ -446,7 +446,7 @@ function checkMessages(options) { if (options.clockIfAllRead && newMessages.length==0) return load(); active = "list"; - // Otherwise show a menu + // Otherwise show a list of messages E.showScroller({ h : 48, c : Math.max(MESSAGES.length,3), // workaround for 2v10.219 firmware (min 3 not needed for 2v11) @@ -469,17 +469,21 @@ function checkMessages(options) { .setColor(fg); // only color the icon x += 50; } - var m = msg.title+"\n"+msg.body, longBody=false; if (title) g.setFontAlign(-1,-1).setFont(fontBig).drawString(title, x,r.y+2); + var longBody = false; if (body) { g.setFontAlign(-1,-1).setFont("6x8"); + // if the body includes an image, it probably won't be small enough to allow>1 line + let maxLines = 3, pady = 0; + if (body.includes("\0")) { maxLines=1; pady=4; } var l = g.wrapString(body, r.w-(x+14)); - if (l.length>3) { - l = l.slice(0,3); + if (l.length>maxLines) { + l = l.slice(0,maxLines); l[l.length-1]+="..."; } longBody = l.length>2; - g.drawString(l.join("\n"), x+10,r.y+20); + // draw the body + g.drawString(l.join("\n"), x+10,r.y+20+pady); } if (!longBody && msg.src) g.setFontAlign(1,1).setFont("6x8").drawString(msg.src, r.x+r.w-2, r.y+r.h-2); g.setColor("#888").fillRect(r.x,r.y+r.h-1,r.x+r.w-1,r.y+r.h-1); // dividing line between items diff --git a/apps/messagegui/metadata.json b/apps/messagegui/metadata.json index 7fa7cee5d3e..6f2cb5d2e72 100644 --- a/apps/messagegui/metadata.json +++ b/apps/messagegui/metadata.json @@ -2,7 +2,7 @@ "id": "messagegui", "name": "Message UI", "shortName": "Messages", - "version": "0.74", + "version": "0.75", "description": "Default app to display notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", diff --git a/apps/messages_light/ChangeLog b/apps/messages_light/ChangeLog index e4e91cb3fcc..37b9c4c5e4a 100644 --- a/apps/messages_light/ChangeLog +++ b/apps/messages_light/ChangeLog @@ -7,4 +7,5 @@ 1.3: icon changed 1.4: new management of events implemented; removed code no longer used (from now the music will be managed by the Messagesgui app) 1.5: Fix graphic bug; View via popup while there are other open apps -1.6: fix for #2689; ( white screen ) \ No newline at end of file +1.6: fix for #2689; ( white screen ) +1.7: Fix removal notification from the list of current notifications \ No newline at end of file diff --git a/apps/messages_light/messages_light.app.js b/apps/messages_light/messages_light.app.js index efb07f0976d..fc50cc1008d 100644 --- a/apps/messages_light/messages_light.app.js +++ b/apps/messages_light/messages_light.app.js @@ -87,6 +87,8 @@ var manageEvent = function(event) { showMessage(event); } else if(event.t=="remove"){ + + //se non c'è niente nella queue e non c'è una chiamata in corso if( EventQueue.length==0 && !callInProgress) next(); @@ -104,7 +106,8 @@ var manageEvent = function(event) { }); //non sovrascrivo, cosi uso lo stesso oggetto in memoria e dovrei avere meno problemi di memory leak - EventQueue.length=0; + //EventQueue.length=0; // non più funzionante! + EventQueue.splice(0,EventQueue.length); newEventQueue.forEach(element => { EventQueue.push(element); }); diff --git a/apps/messages_light/messages_light.listener.js b/apps/messages_light/messages_light.listener.js index 2525a52bd8d..e9a8b10cba8 100644 --- a/apps/messages_light/messages_light.listener.js +++ b/apps/messages_light/messages_light.listener.js @@ -3,11 +3,11 @@ let overlayTimeout=undefined; exports.listener = function(type, event) { - //salva gli eventi che arrivano su file - /* events=require("Storage").readJSON("events_log",true) || []; + //salva gli eventi che arrivano su file TOREMOVE + /*events=require("Storage").readJSON("events_log",true) || []; events.push ( event) - require("Storage").writeJSON("events_log",events); - */ + require("Storage").writeJSON("events_log",events);*/ + //if (event.handled) return; // already handled/app open if( type=="clearAll" || type=="music" || event.id=="music") return; //lo lascio gestire a qualcun altro diff --git a/apps/messages_light/metadata.json b/apps/messages_light/metadata.json index f5f883ae28e..8c454b33dd3 100644 --- a/apps/messages_light/metadata.json +++ b/apps/messages_light/metadata.json @@ -1,7 +1,7 @@ { "id": "messages_light", "name": "Messages Light", - "version": "1.6", + "version": "1.7", "description": "A light implementation of messages App (display notifications from iOS and Gadgetbridge/Android)", "icon": "app.png", "type": "app", diff --git a/apps/setting/ChangeLog b/apps/setting/ChangeLog index 50ffea933e4..a8285c91f9c 100644 --- a/apps/setting/ChangeLog +++ b/apps/setting/ChangeLog @@ -75,4 +75,5 @@ of 'Select Clock' 0.65: Prepend 'LCD->Calibration' touch listener and stop event propagation. 0.66: Fix LCD calibration bug where it would come on again after the calibration was done. - +0.67: Rename 'Wake on BTN1/Touch' to 'Wake on Button/Tap' on Bangle.js 2 +0.68: Fix syntax error diff --git a/apps/setting/README.md b/apps/setting/README.md index 18aa8af46f0..81a37adfe68 100644 --- a/apps/setting/README.md +++ b/apps/setting/README.md @@ -32,7 +32,7 @@ This is Bangle.js's settings menu * **Rotation** allows you to rotate (or mirror) what's displayed on the screen, eg. for left-handed wearers (needs 2v16 or 2v15 cutting edge firmware to work reliably) * **Wake on X** should the given activity wake up the Bangle.js LCD? * On Bangle.js 2 when locked the touchscreen is turned off to save power. Because of this, - `Wake on Touch` actually uses the accelerometer, and you need to actually tap the display to wake Bangle.js. + `Wake on Touch` actually uses the accelerometer, and you need to actually tap the display to wake Bangle.js (we recently renamed the menu item to `Wake on Tap`). * **Twist X** these options adjust the sensitivity of `Wake on Twist` to ensure Bangle.js wakes up with just the right amount of wrist movement. * **Calibrate** on Bangle.js 2, pop up a screen allowing you to calibrate the touchscreen (calibration only works on 2v16 or 2v15 cutting edge builds) diff --git a/apps/setting/metadata.json b/apps/setting/metadata.json index 412bad6f66e..d7c442fb6c9 100644 --- a/apps/setting/metadata.json +++ b/apps/setting/metadata.json @@ -1,7 +1,7 @@ { "id": "setting", "name": "Settings", - "version": "0.66", + "version": "0.68", "description": "A menu for setting up Bangle.js", "icon": "settings.png", "tags": "tool,system", diff --git a/apps/setting/settings.js b/apps/setting/settings.js index 6ecd8c808d1..a259a78626c 100644 --- a/apps/setting/settings.js +++ b/apps/setting/settings.js @@ -448,17 +448,35 @@ function showLCDMenu() { g.setRotation(settings.rotate&3,settings.rotate>>2).clear(); Bangle.drawWidgets(); } - }, - /*LANG*/'Wake on BTN1': { + } + }); + + if (BANGLEJS2) + Object.assign(lcdMenu, { + /*LANG*/'Wake on Button': { + value: settings.options.wakeOnBTN1, + onchange: () => { + settings.options.wakeOnBTN1 = !settings.options.wakeOnBTN1; + updateOptions(); + } + }, + /*LANG*/'Wake on Tap': { + value: settings.options.wakeOnTouch, + onchange: () => { + settings.options.wakeOnTouch = !settings.options.wakeOnTouch; + updateOptions(); + } + } + }); + else + Object.assign(lcdMenu, { + /*LANG*/'Wake on BTN1': { value: settings.options.wakeOnBTN1, onchange: () => { settings.options.wakeOnBTN1 = !settings.options.wakeOnBTN1; updateOptions(); } - } - }); - if (!BANGLEJS2) - Object.assign(lcdMenu, { + }, /*LANG*/'Wake on BTN2': { value: settings.options.wakeOnBTN2, onchange: () => { @@ -472,6 +490,13 @@ function showLCDMenu() { settings.options.wakeOnBTN3 = !settings.options.wakeOnBTN3; updateOptions(); } + }, + /*LANG*/'Wake on Touch': { + value: settings.options.wakeOnTouch, + onchange: () => { + settings.options.wakeOnTouch = !settings.options.wakeOnTouch; + updateOptions(); + } }}); Object.assign(lcdMenu, { /*LANG*/'Wake on FaceUp': { @@ -481,13 +506,6 @@ function showLCDMenu() { updateOptions(); } }, - /*LANG*/'Wake on Touch': { - value: settings.options.wakeOnTouch, - onchange: () => { - settings.options.wakeOnTouch = !settings.options.wakeOnTouch; - updateOptions(); - } - }, /*LANG*/'Wake on Twist': { value: settings.options.wakeOnTwist, onchange: () => { diff --git a/apps/speedalt/metadata.json b/apps/speedalt/metadata.json index 1ecb2b5626e..255a0e550c8 100644 --- a/apps/speedalt/metadata.json +++ b/apps/speedalt/metadata.json @@ -8,7 +8,7 @@ "type": "app", "tags": "tool,outdoors", "supports": ["BANGLEJS","BANGLEJS2"], - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "readme": "README.md", "allow_emulator": true, "storage": [ diff --git a/apps/speedalt2/metadata.json b/apps/speedalt2/metadata.json index 2c8d37f7920..1b0ba06bb1a 100644 --- a/apps/speedalt2/metadata.json +++ b/apps/speedalt2/metadata.json @@ -8,7 +8,7 @@ "type": "app", "tags": "tool,outdoors", "supports": ["BANGLEJS"], - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "readme": "README.md", "allow_emulator": true, "storage": [ diff --git a/apps/waypointer/metadata.json b/apps/waypointer/metadata.json index b8f28fbb958..189639d617c 100644 --- a/apps/waypointer/metadata.json +++ b/apps/waypointer/metadata.json @@ -6,7 +6,7 @@ "icon": "waypointer.png", "tags": "tool,outdoors,gps", "supports": ["BANGLEJS", "BANGLEJS2"], - "dependencies" : { "waypoints":"type", "magnav" : "app" }, + "dependencies" : { "waypoints":"app", "magnav" : "app" }, "readme": "README.md", "storage": [ {"name":"waypointer.app.js","url":"app.js"}, diff --git a/apps/waypoints/ChangeLog b/apps/waypoints/ChangeLog index fb57125876f..ed3d1bc9b8b 100644 --- a/apps/waypoints/ChangeLog +++ b/apps/waypoints/ChangeLog @@ -1,2 +1,4 @@ 0.01: New App! 0.02: Merge waypoint_editor here, so waypoints can be edited on device, too. +0.03: Do not register as type waypoint - show in launcher + Fixes for Bangle.js 1 & not installed textinput diff --git a/apps/waypoints/metadata.json b/apps/waypoints/metadata.json index db5b2e62720..b2121e00ddd 100644 --- a/apps/waypoints/metadata.json +++ b/apps/waypoints/metadata.json @@ -1,10 +1,9 @@ { "id": "waypoints", "name": "Waypoints", - "version":"0.02", + "version":"0.03", "description": "Provides 'waypoints.json' used by various navigation apps, as well as a way to edit it from the App Loader or from the device", "icon": "app.png", "tags": "tool,outdoors,gps", - "type": "waypoints", "supports" : ["BANGLEJS","BANGLEJS2"], "readme": "README.md", "interface": "interface.html", diff --git a/apps/waypoints/waypoints.app.js b/apps/waypoints/waypoints.app.js index cbdcdbfd374..fec1af993b3 100644 --- a/apps/waypoints/waypoints.app.js +++ b/apps/waypoints/waypoints.app.js @@ -1,6 +1,7 @@ /* Thanks to pinsafe from BangleApps repository */ var Layout = require("Layout"); +const BANGLEJS2 = process.env.HWVERSION == 2; // check for bangle 2 const W = g.getWidth(); const H = g.getHeight(); @@ -23,20 +24,27 @@ function writeWP() { } function mainMenu() { + let textInputInstalled = true; + try { + require("textinput") + } catch(err) { + textInputInstalled = false; + } var menu = { - "< Back" : Bangle.load + "< Back" : () => load() }; - if (Object.keys(wp).length==0) { - //Object.assign(menu, {"NO WPs":""}); - print("(no waypoints)"); - } else for (let id in wp) { + for (let id in wp) { let i = id; menu[wp[id]["name"]]=()=>{ show(i); }; } - menu["Add"]=addCard; + if (textInputInstalled && BANGLEJS2) { + menu["Add"]=addCard; + } menu["Remove"]=removeCard; menu["Format"]=setFormat; - menu["Mark GPS"]=markGps; + if (textInputInstalled) { + menu["Mark GPS"]=markGps; + } g.clear(); E.showMenu(menu); } @@ -153,16 +161,14 @@ function lon(x) { } function show(pin) { - print(pin); var i = wp[pin]; - var l = i["name"] + "\n" + lat(i["lat"]) + "\n" + lon(i["lon"]); - var la = new Layout ({ - type:"v", c: [ - {type:"txt", font:"10%", pad:1, fillx:1, filly:1, label: l}, - {type:"btn", font:"10%", pad:1, fillx:1, filly:1, label:"OK", cb:l=>{mainMenu();}} - ], lazy:true}); - g.clear(); - la.render(); + var l = lat(i["lat"]) + "\n" + lon(i["lon"]); + E.showPrompt(l,{ + title:i["name"], + buttons : {"Ok":true} + }).then(function(v) { + mainMenu(); + }); } function showNumpad(text, key_, callback) { @@ -231,22 +237,17 @@ function removeCard() { wp.forEach((val, card) => { const name = wp[card].name; menu[name]=()=>{ - E.showMenu(); - var confirmRemove = new Layout ( - {type:"v", c: [ - {type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:"Delete"}, - {type:"txt", font:"15%", pad:1, fillx:1, filly:1, label:name}, - {type:"h", c: [ - {type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: "YES", cb:l=>{ - wp.splice(card, 1); - writeWP(); - mainMenu(); - }}, - {type:"btn", font:"15%", pad:1, fillx:1, filly:1, label: " NO", cb:l=>{mainMenu();}} - ]} - ], lazy:true}); - g.clear(); - confirmRemove.render(); + E.showPrompt(name,{ + title:"Delete", + }).then(function(v) { + if (v) { + wp.splice(card, 1); + writeWP(); + mainMenu(); + } else { + mainMenu(); + } + }); }; }); } @@ -345,5 +346,4 @@ function addCard() { } g.reset(); -Bangle.setUI(); mainMenu(); diff --git a/apps/wpmoto/metadata.json b/apps/wpmoto/metadata.json index 32c41d75709..eabb176670b 100644 --- a/apps/wpmoto/metadata.json +++ b/apps/wpmoto/metadata.json @@ -9,7 +9,7 @@ "supports": ["BANGLEJS","BANGLEJS2"], "screenshots": [{"url":"screenshot.png"},{"url":"screenshot-menu.png"},{"url":"screenshot-delete.png"}], "readme": "README.md", - "dependencies" : { "waypoints":"type" }, + "dependencies" : { "waypoints":"app" }, "storage": [ {"name":"wpmoto.app.js","url":"app.js"}, {"name":"wpmoto.img","url":"icon.js","evaluate":true}