From eb564d20a442a1da4bee764e1bac93b60211d40b Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Tue, 7 Dec 2021 14:12:33 +0100 Subject: [PATCH 01/30] ios 0.05: Added more bundleId's (app-id's which can be used to determine a friendly app name in the notifications) locale 0.12: Fixed nl_NL formatting, because the full months won't fit on the Bangle.js2's screen --- apps.json | 4 ++-- apps/ios/ChangeLog | 2 ++ apps/ios/boot.js | 19 +++++++++++++++++-- apps/locale/ChangeLog | 1 + apps/locale/locales.js | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/apps.json b/apps.json index bf69480ff..9905a0cdc 100644 --- a/apps.json +++ b/apps.json @@ -95,7 +95,7 @@ { "id": "ios", "name": "iOS Integration", - "version": "0.04", + "version": "0.05", "description": "(BETA) App to display notifications from iOS devices", "icon": "app.png", "tags": "tool,system,ios,apple,messages,notifications", @@ -197,7 +197,7 @@ { "id": "locale", "name": "Languages", - "version": "0.11", + "version": "0.12", "description": "Translations for different countries", "icon": "locale.png", "type": "locale", diff --git a/apps/ios/ChangeLog b/apps/ios/ChangeLog index dd8a3549b..5bafc4d98 100644 --- a/apps/ios/ChangeLog +++ b/apps/ios/ChangeLog @@ -2,3 +2,5 @@ 0.02: Remove messages on disconnect 0.03: Handling of message actions (ok/clear) 0.04: Added common bundleId's +0.05: Added more bundleId's (app-id's which can be used to + determine a friendly app name in the notifications) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 875f00067..33eb8261c 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -54,25 +54,40 @@ E.on('notify',msg=>{ "name" : string, */ var appNames = { - "nl.ah.Appie": "Albert Heijn", + "com.apple.facetime": "FaceTime", "com.apple.mobilecal": "Calendar", "com.apple.mobilemail": "Mail", + "com.apple.Passbook": "iOS Wallet", "com.apple.reminders": "Reminders", "com.apple.shortcuts": "Shortcuts", "com.atebits.Tweetie2": "Twitter", "com.burbn.instagram" : "Instagram", "com.facebook.Facebook": "Facebook", "com.facebook.Messenger": "FB Messenger", + "com.google.Chromecast" : "Google Home", "com.google.Gmail" : "GMail", "com.google.hangouts" : "Hangouts", "com.google.ios.youtube" : "YouTube", + "com.hammerandchisel.discord" : "Discord", + "com.ifttt.ifttt" : "IFTTT", "com.jumbo.app" : "Jumbo", + "com.linkedin.LinkedIn" : "LinkedIn", + "com.nestlabs.jasper.release" : "Nest", "com.netflix.Netflix" : "Netflix", + "com.reddit.Reddit" : "Reddit", "com.skype.skype": "Skype", "com.skype.SkypeForiPad": "Skype", "com.spotify.client": "Spotify", - "net.whatsapp.WhatsApp": "WhatsApp", + "com.tinyspeck.chatlyio": "Slack", + "com.toyopagroup.picaboo": "Snapchat", + "com.ubercab.UberClient": "Uber", + "com.ubercab.UberEats": "UberEats", "com.wordfeud.free": "WordFeud", + "com.zhiliaoapp.musically": "TikTok", + "net.whatsapp.WhatsApp": "WhatsApp", + "nl.ah.Appie": "Albert Heijn", + "nl.postnl.postnl": "PostNL", + "ph.telegra.Telegraph": "Telegram", // could also use NRF.ancsGetAppInfo(msg.appId) here }; diff --git a/apps/locale/ChangeLog b/apps/locale/ChangeLog index ec74955e9..ac4352f33 100644 --- a/apps/locale/ChangeLog +++ b/apps/locale/ChangeLog @@ -11,3 +11,4 @@ 0.09: Added New Zealand en_NZ 0.10: Apply 12hour setting to time 0.11: Added translations for nl_NL and changes one formatting +0.12: Fixed nl_NL formatting, because the full months won't fit on the Bangle.js2's screen diff --git a/apps/locale/locales.js b/apps/locale/locales.js index e076b70bd..2e29eb82a 100644 --- a/apps/locale/locales.js +++ b/apps/locale/locales.js @@ -184,7 +184,7 @@ var locales = { temperature: "°C", ampm: { 0: "", 1: "" }, timePattern: { 0: "%HH:%MM:%SS", 1: "%HH:%MM" }, - datePattern: { 0: "%B %d %Y", 1: "%d.%m.%y" }, // zondag 1 maart 2020 // 01.01.20 + datePattern: { 0: "%d %b %Y", 1: "%d-%m-%Y" }, // 28 feb 2020 // 28-02-2020 abday: "zo,ma,di,wo,do,vr,za", day: "zondag,maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag", abmonth: "jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec", From d3d6a845ff1fdf41545ceeba487d03ddd7deeebc Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 17:48:39 +0000 Subject: [PATCH 02/30] Added scribble app, icon and params. --- apps/scribble/ChangeLog | 1 + apps/scribble/README.md | 25 ++ apps/scribble/add_to_apps.json | 14 + apps/scribble/app-icon.js | 1 + apps/scribble/app.png | Bin 0 -> 1162 bytes apps/scribble/scribble.js | 469 +++++++++++++++++++++++++++++++++ 6 files changed, 510 insertions(+) create mode 100644 apps/scribble/ChangeLog create mode 100644 apps/scribble/README.md create mode 100644 apps/scribble/add_to_apps.json create mode 100644 apps/scribble/app-icon.js create mode 100644 apps/scribble/app.png create mode 100644 apps/scribble/scribble.js diff --git a/apps/scribble/ChangeLog b/apps/scribble/ChangeLog new file mode 100644 index 000000000..af7f83942 --- /dev/null +++ b/apps/scribble/ChangeLog @@ -0,0 +1 @@ +0.01: Initial release diff --git a/apps/scribble/README.md b/apps/scribble/README.md new file mode 100644 index 000000000..dc139bc9a --- /dev/null +++ b/apps/scribble/README.md @@ -0,0 +1,25 @@ +# App Name + +Describe the app... + +Add screen shots (if possible) to the app folder and link then into this file with ![](.png) + +## Usage + +Describe how to use it + +## Features + +Name the function + +## Controls + +Name the buttons and what they are used for + +## Requests + +Name who should be contacted for support/update requests + +## Creator + +Your name diff --git a/apps/scribble/add_to_apps.json b/apps/scribble/add_to_apps.json new file mode 100644 index 000000000..054f35d55 --- /dev/null +++ b/apps/scribble/add_to_apps.json @@ -0,0 +1,14 @@ +{ "id": "scribble", + "name": "Scribble", + "shortName":"Scribble", + "version":"0.01", + "description": "A keyboard on your wrist!", + "icon": "app.png", + "tags": "keyboard, text, scribble", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"scribble.app.js","url":"app.js"}, + {"name":"scribble.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/scribble/app-icon.js b/apps/scribble/app-icon.js new file mode 100644 index 000000000..b77fc9a4f --- /dev/null +++ b/apps/scribble/app-icon.js @@ -0,0 +1 @@ +var img = require("heatshrink").decompress(atob("mEwwMB/4A2/IFE+IFE+YFE84FE44FE54SEz/jAocfDAk/54EC/1/x4FC/l/z4FDCQJGD/wFD+IYBIwYSBIwf4IwhfEIwuPIwkPIwMAj//g/P/gFCkOP/AEB/8wj5+Dn0/Aoc8n/4JAU4v/8gYFBaYWAJ4MHAoPwEgMPOgUfLogJCBYQFE+AFD8BHB/EAAAV/AoYyCB4IKBc6QA==")) \ No newline at end of file diff --git a/apps/scribble/app.png b/apps/scribble/app.png new file mode 100644 index 0000000000000000000000000000000000000000..01a6acb72d8d7fe7774e993726f28dd5d6b20927 GIT binary patch literal 1162 zcmV;51aPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D1RqI6K~!i%?U`w) zjd>i$@7N7vUk9Zu#grvt#yWXLwnSM{2u&el5?;v*qIrQNioy$qY#EW1t(2*;lx;Bf zE&CWVCj0jJxaXOU<9W_;?!Cw3=6vhZIrrRqp6B`f{=e=2zXf^al~-PQeby?Qcr8iQ zgdd<9+=Hi3YE%h^!yoV)d=EKQnZ#>J=nH5LL!llVNKk6@70iGKum@^EsZwXS4i}&= zMCF%;)_{^+{bH*T?1H;67wSNm%E2gbrP}+!r=aRE5%m0a=m_RRs`PkII1Z;^AjGbU zFaS=&N$3Yrq4PCt0?X}G-?`{;8)=rh&>0a`9Hx!_#JFu zVbW0h!9n;7MnGkVU0uLfHui@=lt&GfrEmw9Ky8R!4PXQKQ1cT%hsn?x2CmRH_zq&1 zb=-LV8}@-K5mt5ltPLE2D`4mtcCpGNHJ;DIO|X1MRh_D^5nh0+<#-XhY*;?jGguE5 zAWRzdBN$>D+YM}DvC8G20zTAXXbDlF(*yQ{VKxa|jo76ZErpk0G^A@-i$OzeSoI-x zSqhiKZLlP!t2!p@MK}f~c;YAv$eII>;5nRw@sPS%(NOonH{eg`15p(!kl%4Soef*T zu5Qx5PD9qR^sNQG@55gMW7`Q-@46a#>s#0j4s|oZ5j&mS6L_t#hfK$N%Cy8*lzGq# zmVx;&0SqbY`%X9uy?23ak#^EEmgdGMiiO+H_E|A?Df7kkvlg3tA&HlE-B%R^ePVQ=s=e`oF(!~TOq`8QT7 z2f$#u4Bop%wOK|Th$U+W*gP#N8I` 200 ? 2 : 1; +const rowN = 7; +const colN = 7; +const headerH = maxY / 7; +const rowH = (maxY - headerH) / rowN; +const colW = maxX / colN; + +function getRndInteger(min, max) { + return Math.floor(Math.random() * (max - min)) + min; +} + +class Window { + constructor(label, bgCol) { + this.label = "win_" + this.label += (typeof label !== "undefined") ? label : "Unset"; + console.log(`Constructing Window ${this.label}, args: ${arguments}`) + + this.bgCol = bgCol; + this.layers = []; + } + + push(layer) { + layer.label=`${this.layers.length}_${layer.label}`; + this.layers.push(layer); + } + pop() { + this.layers.pop(); + } + + top_layer() { + return this.layers[this.layers.length - 1]; + } + + render() { + + if (this.bgCol !== transp) { + console.log(`${this.label}: filling bg in ${this.bgCol}`); + g.setColor(this.bgCol); + g.fillRect(0, 0, g.getWidth(), g.getHeight()); + } + + + let i = 0; + this.layers.forEach((lyr) => { + // console.log(`Rendering Layer ${i} ${lyr.label}`) + i++; + lyr.render(); + }); + } +} + +class Layer { + constructor(label) { + + this.label = "lyr_" + + this.label += (typeof label !== "undefined") ? label : "Unset"; + console.log(`Constructing Layer ${this.label}, args: ${arguments}`) + this.items = []; + // console.log(`bg is ${bg} type ${typeof bg}`) + + } + + push(button) { + this.items.push(button); + } + + setLabel(label) { + this.label = label; + } + + parseTaps(xy) { + this.items.forEach(item => { + // // print(item) + if (item.was_tapped(xy)) { + // pass parent layer to the tapped button + item.callback(this); + } + }); + } + + render() { + + this.items.forEach((item) => { + + item.render(); + }); + } +} + +class BTN_layer extends Layer { + + constructor(label, layout) { + + Layer.call(this, label) + + this.alphabet = (uppercase) ? abc.toUpperCase() : abc; + console.log(`Constructing BTN_Layer ${this.label}, layout ${this.layout}`) + + if (layout in points) { + + this.create_layout(layout); + + } + else { + throw `Invalid layout passed ->[${layout}]`; + } + + // // print(this); + + } + + render() { + + Layer.prototype.render.call(this); + } + + create_layout(layout) { + + console.log(`Creating layout ${layout}`); + + let start_p = 0; + + this.items = this.push_buttons(points[layout], this.alphabet, start_p, chunk_size) + + } + + push_buttons(points, in_string, start_p) { + + items = []; + spacer = "" // char interposed b/w the two halves of text per button + + for (let i = 0; i < points.length; i++) { + substr = `${in_string.substring( + start_p, + start_p + chunk_size / 2 + )}${spacer}${in_string.substring(start_p + chunk_size / 2, start_p + chunk_size)}`; + + btn_label = + uppercase === 1 + ? substr.toUpperCase() + : substr; + + start_p += chunk_size; + + items.push( + new Button( + i, // ID of button + points[i].x, // left + points[i].y, // top + btn_label, // text to render in the button + box_size.w, // width + box_size.h, // height + g.theme.bg, // box bg + white, // box fill + black // text col + ) + ); + } + + return items; + } + + update_labels(in_string, start_p, chk_size) { + // print(`Updating labels | in_string ${in_string} start_p ${start_p} chk_size ${chk_size}`); + in_string.replace('\n', ''); // remove newlines just in case + + spacer = "" // char interposed b/w the two halves of text per button + + for (let i = 0; i < this.items.length; i++) { + + item = this.items[i]; + substr = (chk_size < 3) + ? in_string.substring(start_p + chk_size * i, start_p + (chk_size * (i + 1))) + : `${in_string.substring( + start_p + chk_size * i, + start_p + chk_size * i + chk_size / 2 + )}${spacer}${in_string.substring(start_p + chk_size * i + chk_size / 2, start_p + chk_size * i + chk_size)}`; + // // print(`(chk_size > 3): ${(chk_size > 3)}`) + // print(`Label ${i} -> ${substr}`); + item.setLabel(substr); + } + + } + + zoom_in(id) { + let start_p = id * chunk_size; + // print(`Zooming in | start_p ${start_p}`) + if (chunk_size % this.items.length !== 0) { + throw `Chunk size [${chunk_size}] does not fit #btns [${this.items.length}]` + } + subchunk_size = chunk_size / this.items.length; + + substr = this.alphabet.substring(start_p, start_p + chunk_size); + // print(`substr ${substr}`); + // print(`subchunk_size ${subchunk_size}`); + this.update_labels(substr, 0, subchunk_size); + + } + +} + +class Button { + constructor(id, x, y, text, w, h, col, bgCol, txtCol, font) { + this.id = id; + this.label = `btn_${this.id}`; + + this.text = text; + this.x1 = x; + this.y1 = y; + this.w = w; + this.h = h; + this.col = typeof col !== "undefined" ? col : black; + this.bgCol = typeof bgCol !== "undefined" ? bgCol : gray2; + this.txtCol = typeof txtCol !== "undefined" ? txtCol : black; + // this.font = font; + + this.x2 = this.x1 + this.w; + this.y2 = this.y1 + this.h; + this.center = { + x: (this.x1 + this.x2) / 2, + y: (this.y1 + this.y2) / 2, + }; + + + console.log(`Constructed button `) + // // print(this); + } + + render() { + // console.log( + // `Button ${this.text} -> P1: (${this.x1}, ${this.y1}) | P2: (${this.x2}, ${this.y2})` + // ); + + g.setColor(this.bgCol); + g.fillRect(this.x1, this.y1, this.x2, this.y2); + g.setColor(this.col); + g.drawRect(this.x1, this.y1, this.x2, this.y2); + g.setColor(this.txtCol); + + g.setFontAlign(0, 0).setFont(global_font, font_height); + g.drawString(this.text, this.center.x, this.center.y); + } + + // short tap callback func + callback(parent_layer) { + // print(`Tapped button ${this.id}`); + + // this.highlight(); // TODO set up highlighting + if (last_layer) { + l_text.items[0].text += this.text; + // print(`Updated buffer to ${l_text.items[0].text}`) + parent_layer.update_labels(parent_layer.alphabet, 0, chunk_size); + last_layer = false; + } + else { + parent_layer.zoom_in(this.id); + last_layer = true; + } + } + + was_tapped(xy) { + var x = xy.x; + var y = xy.y; + + if ((x > this.x1 && x < this.x2) && (y > this.y1 && y < this.y2)) { + return true; + } + else { + return false; + } + } + + setLabel(lbl) { + // // print(`Button ${this.id}, updating label ${this.text} with ${lbl}`); + this.text = lbl; + } + + getLabel(lbl) { + + return this.label; + } + + highlight() { + + g.setColor(g.theme.bgH); + g.fillRect(this.x1, this.y1, this.x2, this.y2); + g.setColor(g.theme.fgH); + g.drawRect(this.x1, this.y1, this.x2, this.y2); + g.setColor(this.fg); + + g.setFontAlign(0, 0).setFont(global_font, font_height); + g.drawString(this.text, this.center.x, this.center.y); + + } + +} + +class TextBox { + + constructor(x, y, text, col) { + + // x and y are the center points + this.x = x; + this.y = y; + this.text = (typeof text !== undefined) ? text : "Default"; + this.col = (typeof col !== undefined) ? col : red; + + // console.log(`Constr TextBox ${this.text} -> Center: (${this.x}, ${this.y}) | Col ${this.col}`); + } + + render() { + // console.log(`Rendering TextBox`) + + var align_center = (0, 1); + var align_right = (0, 0); + alignment = (g.stringWidth(this.text) < g.getWidth()) ? align_center : align_right; + // coords = (g.stringWidth(this.text) < g.getWidth()- 20) ? {x:this.x, y:this.y} : {x:g.getWidth()-border, y:this.y} + coords = { x: this.x, y: this.y }; + g.setColor(this.col); + g.setFontAlign(0, 0).setFont(global_font, font_height); + g.drawString(this.text, coords.x, coords.y); + + } +} + +/* Screen refresh *************************************/ + +function draw(obj) { + console.log("draw()"); + obj.render(); +} + +let tickTimer; + +function clearTickTimer() { + if (tickTimer) { + clearTimeout(tickTimer); + tickTimer = undefined; + } +} + +function queueNextTick() { + clearTickTimer(); + tickTimer = setTimeout(tick, 5000); +} + +function tick() { + console.log("tick"); + draw(window); + // queueNextTick(); +} + +/* Init **********************************************/ + +var window = new Window("abc", red); + +var l_btns = new BTN_layer("btns", "3x2"); + +var l_text = new Layer("text"); // black + +var box = new TextBox( + _screen_mid, + 12, + editable_buf, + white +); + +l_text.push(box); + +window.push(l_text); +window.push(l_btns); + +// Set up callbacks for touches + +Bangle.on('touch', function (button, xy) { + + window.top_layer().parseTaps(xy); + window.render(); + +}); + +Bangle.on('swipe', function (direction) { + + console.log(`Swipe dir ${direction}`); + + if (direction === -1) { // left + + l_text.items[0].text = l_text.items[0].text.slice(0, -1); + + } else if (direction == 1) { // right + + l_text.items[0].text += ' '; + + } + window.render(); + +}); + +// Clear the screen once, at startup +g.clear(); + +// Start ticking +tick(); \ No newline at end of file From 5674014334fb999c08a8ff313a1441a9885447fd Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 17:59:18 +0000 Subject: [PATCH 03/30] Add scribble to apps.json --- apps.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps.json b/apps.json index 13bb5892d..a0e024300 100644 --- a/apps.json +++ b/apps.json @@ -4780,5 +4780,21 @@ {"name": "flow.app.js", "url": "app.js" }, {"name": "flow.img", "url": "app-icon.js","evaluate": true } ] + }, + { "id": "scribble", + "name": "Scribble", + "shortName":"Scribble", + "version":"0.01", + "description": "A keyboard on your wrist! Swipe right for space, left for delete.", + "icon": "app.png", + "allow_emulator": true, + "tags": "tools, keyboard, text, scribble", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"scribble.app.js","url":"app.js"}, + {"name":"scribble.img","url":"app-icon.js","evaluate":true} + ] } + ] From 186913c088dcf3c9ffcbc5e66a794558aa414d65 Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 18:04:11 +0000 Subject: [PATCH 04/30] Add scribble type --- apps.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps.json b/apps.json index a0e024300..b2f809904 100644 --- a/apps.json +++ b/apps.json @@ -4785,6 +4785,7 @@ "name": "Scribble", "shortName":"Scribble", "version":"0.01", + "type": "app", "description": "A keyboard on your wrist! Swipe right for space, left for delete.", "icon": "app.png", "allow_emulator": true, From f46810aa65fef333516bde2686491dd32fc799e1 Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 18:04:27 +0000 Subject: [PATCH 05/30] renamed scribble.js to app.js --- apps/scribble/{scribble.js => app.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename apps/scribble/{scribble.js => app.js} (100%) diff --git a/apps/scribble/scribble.js b/apps/scribble/app.js similarity index 100% rename from apps/scribble/scribble.js rename to apps/scribble/app.js From 254ba37a87673083b4ece4cc9d122d4043ca9769 Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 18:07:30 +0000 Subject: [PATCH 06/30] Fixed app icon --- apps/scribble/app-icon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/scribble/app-icon.js b/apps/scribble/app-icon.js index b77fc9a4f..740706094 100644 --- a/apps/scribble/app-icon.js +++ b/apps/scribble/app-icon.js @@ -1 +1 @@ -var img = require("heatshrink").decompress(atob("mEwwMB/4A2/IFE+IFE+YFE84FE44FE54SEz/jAocfDAk/54EC/1/x4FC/l/z4FDCQJGD/wFD+IYBIwYSBIwf4IwhfEIwuPIwkPIwMAj//g/P/gFCkOP/AEB/8wj5+Dn0/Aoc8n/4JAU4v/8gYFBaYWAJ4MHAoPwEgMPOgUfLogJCBYQFE+AFD8BHB/EAAAV/AoYyCB4IKBc6QA==")) \ No newline at end of file +require("heatshrink").decompress(atob("mEwwMB/4A2/IFE+IFE+YFE84FE44FE54SEz/jAocfDAk/54EC/1/x4FC/l/z4FDCQJGD/wFD+IYBIwYSBIwf4IwhfEIwuPIwkPIwMAj//g/P/gFCkOP/AEB/8wj5+Dn0/Aoc8n/4JAU4v/8gYFBaYWAJ4MHAoPwEgMPOgUfLogJCBYQFE+AFD8BHB/EAAAV/AoYyCB4IKBc6QA==")) \ No newline at end of file From afa4f1d2419ebc9caa0033a9b6ce24b51f65d791 Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 18:49:11 +0000 Subject: [PATCH 07/30] Adjusted button size --- apps/scribble/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/scribble/app.js b/apps/scribble/app.js index e8fb9e4c2..3d05f68c5 100644 --- a/apps/scribble/app.js +++ b/apps/scribble/app.js @@ -19,15 +19,15 @@ const font_height = 2; const global_font = "Dennis8"; require("FontDennis8").add(Graphics); -const editable_buf = "hello"; +const editable_buf = "Scribble"; -const left = 4; +const left = 3; const _screen_mid = g.getWidth() / 2; const right = 176 - 4; const box_size = { w: _screen_mid - 6, - h: 45, + h: 46, }; const spacing = 4; From 97338ff66414d9c7e4651334594cb94726d4b2c0 Mon Sep 17 00:00:00 2001 From: enricorov Date: Tue, 7 Dec 2021 18:49:23 +0000 Subject: [PATCH 08/30] Added screenshots --- apps.json | 3 +++ apps/scribble/screenshot.png | Bin 0 -> 2797 bytes 2 files changed, 3 insertions(+) create mode 100644 apps/scribble/screenshot.png diff --git a/apps.json b/apps.json index b2f809904..dbb2eb972 100644 --- a/apps.json +++ b/apps.json @@ -4795,6 +4795,9 @@ "storage": [ {"name":"scribble.app.js","url":"app.js"}, {"name":"scribble.img","url":"app-icon.js","evaluate":true} + ], + "screenshots":[ + { "url":"screenshot.png" } ] } diff --git a/apps/scribble/screenshot.png b/apps/scribble/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..a3dc0cff25bd99db84b3d6dd1c764d9b8a5c7742 GIT binary patch literal 2797 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 Date: Tue, 7 Dec 2021 18:49:29 +0000 Subject: [PATCH 09/30] Added scribble readme --- apps/scribble/README.md | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/apps/scribble/README.md b/apps/scribble/README.md index dc139bc9a..651ecfbf1 100644 --- a/apps/scribble/README.md +++ b/apps/scribble/README.md @@ -1,25 +1,15 @@ -# App Name +# Scribble -Describe the app... +A tree-based keyboard, inspired by Tertiary Text on Pebble. -Add screen shots (if possible) to the app folder and link then into this file with ![](.png) +![](screenshot.png) ## Usage -Describe how to use it - -## Features - -Name the function - -## Controls - -Name the buttons and what they are used for - -## Requests - -Name who should be contacted for support/update requests +Tap a button to select text. +Swipe left to right for enter space. +Swipe right to left to delete. ## Creator -Your name +enricorov From 478a6a6eda03b3fe14fdf2e9eaf1a4e83abecbee Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Tue, 7 Dec 2021 20:23:15 +0100 Subject: [PATCH 10/30] ios 0.05: Added more bundleId's --- apps/ios/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 33eb8261c..6e8c864a8 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -86,7 +86,7 @@ E.on('notify',msg=>{ "com.zhiliaoapp.musically": "TikTok", "net.whatsapp.WhatsApp": "WhatsApp", "nl.ah.Appie": "Albert Heijn", - "nl.postnl.postnl": "PostNL", + "nl.postnl.TrackNTrace": "PostNL", "ph.telegra.Telegraph": "Telegram", // could also use NRF.ancsGetAppInfo(msg.appId) here From 57e25085dc02734e88da33ac615ebf966202afd3 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 21:20:33 +0100 Subject: [PATCH 11/30] Fix redundant parenthesis --- apps/qrcode/custom.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 618840da9..039b47c23 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -108,7 +108,7 @@ g.clear(1).setColor(1,1,1).setBgColor(0,0,0); g.fillRect(0,0,g.getWidth()-1,g.getHeight()-1); g.drawImage(img,(g.getWidth()-img[0])/2,(g.getHeight()-img[1])/2); g.setFontAlign(0,0).setFont("6x8").setColor(0,0,0); -g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4)); +g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4); g.setColor(1,1,1); `; sendCustomizedApp({ From fd8c1c237f2821ad08e8d53d706b0985f20b7098 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 19:16:41 +0100 Subject: [PATCH 12/30] Allow hiding the description --- apps/qrcode/custom.html | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 039b47c23..5e29d7467 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -3,8 +3,8 @@ - - + +
@@ -25,6 +25,14 @@ +
+

Additional options:

+ +
+ + + +

Try your QR Code:

Click

@@ -101,14 +109,18 @@ if(document.getElementById("useWIFI").checked){ content = document.getElementById("ssid").value } + if(!(document.getElementById("description").value === "")){ + content = document.getElementById("description").value; + } var img = imageconverter.canvastoString(document.getElementsByTagName("canvas")[0],{mode:"1bit",output:"string",compression:true}); var app = `var img = ${img}; -var content = ${JSON.stringify(content)}; +${ document.getElementById("hideDescription").checked ? '' : `var content = ${JSON.stringify(content)};`} g.clear(1).setColor(1,1,1).setBgColor(0,0,0); g.fillRect(0,0,g.getWidth()-1,g.getHeight()-1); g.drawImage(img,(g.getWidth()-img[0])/2,(g.getHeight()-img[1])/2); -g.setFontAlign(0,0).setFont("6x8").setColor(0,0,0); -g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4); +${ document.getElementById("hideDescription").checked ? '' : `g.setFontAlign(0,0).setFont("6x8").setColor(0,0,0); +g.drawString(content,g.getWidth()/2,g.getHeight()-(g.getHeight()-img[1])/4)); +`} g.setColor(1,1,1); `; sendCustomizedApp({ From 8cc770a69e3a54a2e01dd04e67b9e10ce9c0e809 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 19:45:12 +0100 Subject: [PATCH 13/30] Only use integer scaling for clearer QR codes --- apps/qrcode/custom.html | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 5e29d7467..75b9823c5 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -42,21 +42,19 @@ @@ -95,6 +97,7 @@ return qrstring; } function refreshQRCode(){ + document.getElementById("errors").innerText=""; qrcode.clear(); // clear the code. var qrText = ""; if(document.getElementById("useWIFI").checked){ @@ -109,10 +112,17 @@ } qrcode._htOption.text = qrText; qrcode._htOption.correctLevel = parseInt(document.getElementById("correction").value); - qrcode.makeCode(qrText); + try { + qrcode.makeCode(qrText); + } catch (error) { + document.getElementById("errors").innerText="Error: QR could not be created."; + console.error(error); + } var integerScale = Math.max(Math.floor(targetSize / (qrcode._oQRCode.moduleCount + 1)),1); + if (integerScale == 1) document.getElementById("errors").innerText = "Warning, QR will probably be too small to properly scan. Try less data or less error correction."; + finalSizeQr = integerScale * (qrcode._oQRCode.moduleCount + 1); finalSizeCanvas = finalSizeQr - 1; @@ -121,8 +131,12 @@ document.getElementsByTagName("canvas")[0].width = finalSizeCanvas; document.getElementsByTagName("canvas")[0].height = finalSizeCanvas; - - qrcode.makeCode(qrText); + try { + qrcode.makeCode(qrText); + } catch (error) { + document.getElementById("errors").innerText="Error: QR could not be created."; + console.error(error); + } } var qrcode; From 8c313c446e005d011e2b36d839caa486b5ed35a4 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 22:57:35 +0100 Subject: [PATCH 18/30] Update changelog --- apps/qrcode/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/qrcode/ChangeLog b/apps/qrcode/ChangeLog index e2ae6b02a..91121ac6e 100644 --- a/apps/qrcode/ChangeLog +++ b/apps/qrcode/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: Add posibillity to generate Wifi code. +0.03: Forces integer scaling and adds more configuration (error correction, description, display) From e97c3041d8a16843a38e56d8525fd45c300cb249 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 23:08:20 +0100 Subject: [PATCH 19/30] Adds option to prevent integer scaling --- apps/qrcode/custom.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index a92b46338..22aea3422 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -28,6 +28,8 @@

Additional options:

+ +

@@ -119,13 +121,18 @@ console.error(error); } + var finalSizeQr=targetSize; + var finalSizeCanvas=targetSize; + var integerScale = Math.max(Math.floor(targetSize / (qrcode._oQRCode.moduleCount + 1)),1); - if (integerScale == 1) document.getElementById("errors").innerText = "Warning, QR will probably be too small to properly scan. Try less data or less error correction."; - - finalSizeQr = integerScale * (qrcode._oQRCode.moduleCount + 1); - finalSizeCanvas = finalSizeQr - 1; - + + if (!document.getElementById("preventIntegerScaling").checked){ + + finalSizeQr = integerScale * (qrcode._oQRCode.moduleCount + 1); + finalSizeCanvas = finalSizeQr - 1; + } + qrcode._htOption.width = finalSizeQr; qrcode._htOption.height = finalSizeQr; @@ -147,6 +154,7 @@ document.getElementById("hidden").addEventListener("change",refreshQRCode); document.getElementById("useTEXT").addEventListener("change",refreshQRCode); document.getElementById("useWIFI").addEventListener("change",refreshQRCode); + document.getElementById("preventIntegerScaling").addEventListener("change",refreshQRCode); document.getElementById("correction").addEventListener("change",refreshQRCode); document.getElementById("upload").addEventListener("click", function() { var content = document.getElementById("text").value; From d28bbdd286c4a0edd1eea41f6881209454a8fdb2 Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Tue, 7 Dec 2021 23:13:09 +0100 Subject: [PATCH 20/30] Move the additional options group down to make the qr visible --- apps/qrcode/custom.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/qrcode/custom.html b/apps/qrcode/custom.html index 22aea3422..eb9906f57 100644 --- a/apps/qrcode/custom.html +++ b/apps/qrcode/custom.html @@ -26,6 +26,11 @@ + +
+

+

Try your QR Code:

+

Additional options:

@@ -46,14 +51,10 @@ - - -
-

-

Try your QR Code:

- +

Click

+ From e93615e3d3e12ed16e4b0d98dde981e2ea011ea8 Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Tue, 7 Dec 2021 23:19:12 +0100 Subject: [PATCH 21/30] We check lowercase strings, so also lowercase checks :-) --- apps/messages/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/messages/app.js b/apps/messages/app.js index 6c9972fd8..38968ced5 100644 --- a/apps/messages/app.js +++ b/apps/messages/app.js @@ -69,7 +69,7 @@ function getNegImage() { function getMessageImage(msg) { if (msg.img) return atob(msg.img); var s = (msg.src||"").toLowerCase(); - if (s=="Phone") return atob("FxeBABgAAPgAAfAAB/AAD+AAH+AAP8AAP4AAfgAA/AAA+AAA+AAA+AAB+AAB+AAB+OAB//AB//gB//gA//AA/8AAf4AAPAA="); + if (s=="phone") return atob("FxeBABgAAPgAAfAAB/AAD+AAH+AAP8AAP4AAfgAA/AAA+AAA+AAA+AAB+AAB+AAB+OAB//AB//gB//gA//AA/8AAf4AAPAA="); if (s=="skype") return atob("GhoBB8AAB//AA//+Af//wH//+D///w/8D+P8Afz/DD8/j4/H4fP5/A/+f4B/n/gP5//B+fj8fj4/H8+DB/PwA/x/A/8P///B///gP//4B//8AD/+AAA+AA=="); if (s=="hangouts") return atob("FBaBAAH4AH/gD/8B//g//8P//H5n58Y+fGPnxj5+d+fmfj//4//8H//B//gH/4A/8AA+AAHAABgAAAA="); if (s=="whatsapp") return atob("GBiBAAB+AAP/wAf/4A//8B//+D///H9//n5//nw//vw///x///5///4///8e//+EP3/APn/wPn/+/j///H//+H//8H//4H//wMB+AA=="); From 59e36009d61999e8309504eb20e5af5da639db83 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 7 Dec 2021 23:14:29 +0000 Subject: [PATCH 22/30] updated gpsrec and gpstouch README files, added screenshot to gpsrec --- apps.json | 3 ++- apps/gpsrec/README.md | 3 +++ apps/gpsrec/screenshot.png | Bin 0 -> 2230 bytes apps/gpstouch/README.md | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 apps/gpsrec/screenshot.png diff --git a/apps.json b/apps.json index 13bb5892d..c03bb89e0 100644 --- a/apps.json +++ b/apps.json @@ -731,6 +731,7 @@ "description": "Application that allows you to record a GPS track. Can run in background", "icon": "app.png", "tags": "tool,outdoors,gps,widget", + "screenshots": [{"url":"screenshot.png"}], "supports": ["BANGLEJS","BANGLEJS2"], "readme": "README.md", "interface": "interface.html", @@ -4339,7 +4340,7 @@ "version": "0.01", "description": "A touch based GPS watch, shows OS map reference", "icon": "gpstouch.png", - "screenshots": [{"url":"screenshot1.png"},{"url":"screenshot2.png"},{"url":"screenshot3.png"},{"url":"screenshot4.png"}], + "screenshots": [{"url":"screenshot4.png"},{"url":"screenshot2.png"},{"url":"screenshot3.png"},{"url":"screenshot1.png"}], "tags": "tools,app", "supports": ["BANGLEJS2"], "readme": "README.md", diff --git a/apps/gpsrec/README.md b/apps/gpsrec/README.md index 72f744452..71b934111 100644 --- a/apps/gpsrec/README.md +++ b/apps/gpsrec/README.md @@ -8,3 +8,6 @@ This app allows you to record a GPS track. It can run in background. The data ca When you turn on recording, a widget badge that looks like a satellite will appear immediately at the top of the screen. However, the recording does not begin immediately. It usually takes several minutes for the watch to get a [GPS fix](https://en.wikipedia.org/wiki/Time_to_first_fix). You will notice a blinking question mark at the lower left of the badge indicating currently getting a fix. The badge will change when a GPS fix is achieved and that is when the app actually starts writing data to the log file. You can [upload assistant files](https://banglejs.com/apps/#assisted%20gps%20update) to speed up the time spent on getting a GPS fix. +## Viewing a track + +![](screenshot.png) diff --git a/apps/gpsrec/screenshot.png b/apps/gpsrec/screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..f6e001749c0b899e268ddda47fcb03f0d3e2c9a3 GIT binary patch literal 2230 zcmai0dpwkB8y>G0Z%!E!#%T^p%1p{>a&8)Cs4Pk;VuZ#QF+S&0yjvqQC^@zcMN!sa z);X;2U0V8wX&@_+|2t; zO_#Xg>%?Bz2<^FVP-{BkB9i-o|2e{Z9Y(BonW5K&pvK$ z+&~^q5mW#^@_3g&Fwpck+>?2125~Rr{3t)zRWjd^K1YIGB?8sEF&>rfQB$kaoef7o zxyEWok5>eNvPg7Vx{ko8Ay&cMA6J{tI(a!IFm!x)a`nAkzDJbmC!#bzRH*)l{CrqW zJ*=n*in+w_yEXd0BJlI$9HJwdY*%q4QZ7fU^1sJ}qR8U-I z!qozS=vTe^)3d-@f%Acriv6|~%wyAzR~9mj7TH`$uas;HHM`Q~`geXF*x>Aq)*nAy zDcE`&mYj(b?D1(`#G}_+>+&!AKxWpti_LVfHSk)giwf|aAJQe3^Mr<83sbYtPeL!v-4S6$ptY&_i4ge5&klv?WeTz);V#)4uPU=r+2;We5V z_fpW?zz#J)lSU(juXI%B4)KrzDFjofMwn> zbA*^4SUH$$&9UM^$;}JRkNDFo*eA&b0q_7tM^^6yG`1G)Yyp)IS@`!^^Z09G8+yj) zrb+Nj+YUIMokDz0PO=2+Lp+-FJd`k{|JtID0llN_AySOTL|iZXV@_9jv?sW5XTPs+ zB2p9P3CdP;2`>+FnTxI(!5t(HqCPDqBcl*ePvW#37Y{2zFG{#C1)tfvdlU%2uVkPG z=VQ@>yGRkrfGNBr2-I%mc|vMnMyeY4I!7E%K`u^=zEb!HKVoT!lhDcA=0N9?Tg^}T z^!QyAXne872bSK{h-sE@URI3#3h)lCXczL2MZ_h!=tv zDEEZ$w0fXCFiTcQD;adKN<_8)T_UC37F%k=qjo@fkP^H+foEBGnXry}Y4wP4kY_Q^ z^ohBL0d3I|(GP$P&#l!jOsnSx2Z{9GIZ9xCD}&pJ=pbHzdJ)1idjaKj3SW;W0=wf+ zN&Kyw`QLQ+ubgl4Rf7IVqS`AcuYKi?A{=Z*V9A~bHJ&TN5^#xV;f<_x-=!rZu%_D2Cd+>ni(e45@iM&a%v$yMlclCvU|7Tj%_M$l#MS ziJqx0eO$V*rjIg&&Bm*Y#$7JaW9|i0pPB-lECZk8?&hSKS`}dSLV`7(tFccAWNuR# z=2yYDHJH6gNYopsoN1^fA9*bYJ=k%`90OlV{0GD)x~|bP)~x)8p52+?>!wnKMq!A8 zV@D}8T;PG8KJO47`1V^*$ioUQ1g>UTNTJ@E=+;mf4bR2&;$d`NvX42uIE8> zOeG_ExZUCFzVv{l35pFi7?i!aVbA{C6C$v4YY#sn$Gh(uLywNg0IG0Z8@h3~_w0$$ ztjsNVYdyIb?LrN~#3Qj^nrH;>?uQ|p{$0Oik~Ka04@^3HmWkuIg_j2D;A%0IVcE>R z3(e7zkn3Td1VbQ@oo?am$8X!eGew2Ih>H2kLxGeE#6d3lqy=G;4k_thm2c>gqi3h1mEmomYJY)r;ER!PE1N Date: Tue, 7 Dec 2021 23:27:48 +0000 Subject: [PATCH 23/30] updated gpsrec and gpstouch README files, added screenshot to gpsrec --- apps/gpstouch/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/gpstouch/README.md b/apps/gpstouch/README.md index 66733637b..172b5da57 100644 --- a/apps/gpstouch/README.md +++ b/apps/gpstouch/README.md @@ -8,11 +8,11 @@ - Displays the GPS time in the bottom half of the screen when the GPS is powered on, otherwise 00:00:00 - Select display of Course, Speed, Altitude, Longitude, Latitude, Ordinance Servey Grid Reference -Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/) - ## Screenshots ![](screenshot1.png) ![](screenshot2.png) ![](screenshot3.png) ![](screenshot4.png) + +Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/) From 261a680e6c1c4e1fb44d5ac10e37102630c6cb9d Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Wed, 8 Dec 2021 01:40:39 +0100 Subject: [PATCH 24/30] try to use ancsGetAppInfo --- apps/ios/boot.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 6e8c864a8..6821b9549 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -91,6 +91,14 @@ E.on('notify',msg=>{ // could also use NRF.ancsGetAppInfo(msg.appId) here }; + + var aName = ''; + NRF.ancsGetAppInfo( msg.appId ).then( ai => { + aName = ai.title; + }).catch(error => { + aName = appNames[msg.appId] || msg.appId; + }); + var unicodeRemap = { '2019':"'" }; @@ -99,7 +107,7 @@ E.on('notify',msg=>{ require("messages").pushMessage({ t : msg.event, id : msg.uid, - src : appNames[msg.appId] || msg.appId, + src : aName, title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) From f1cb286daf9caa2a5ff84d49795b63fc954be792 Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Wed, 8 Dec 2021 01:45:29 +0100 Subject: [PATCH 25/30] revert --- apps/ios/boot.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 6821b9549..6e8c864a8 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -91,14 +91,6 @@ E.on('notify',msg=>{ // could also use NRF.ancsGetAppInfo(msg.appId) here }; - - var aName = ''; - NRF.ancsGetAppInfo( msg.appId ).then( ai => { - aName = ai.title; - }).catch(error => { - aName = appNames[msg.appId] || msg.appId; - }); - var unicodeRemap = { '2019':"'" }; @@ -107,7 +99,7 @@ E.on('notify',msg=>{ require("messages").pushMessage({ t : msg.event, id : msg.uid, - src : aName, + src : appNames[msg.appId] || msg.appId, title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) From 456c4f40192cdf88b5c4c09d4a4584d13f486bcf Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Wed, 8 Dec 2021 02:05:35 +0100 Subject: [PATCH 26/30] Fix #968: messages app should not pop up with old messages --- apps.json | 4 ++-- apps/ios/ChangeLog | 1 + apps/ios/boot.js | 8 ++++++++ apps/messages/ChangeLog | 1 + apps/messages/lib.js | 6 +++++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/apps.json b/apps.json index 9905a0cdc..fad1e9c6e 100644 --- a/apps.json +++ b/apps.json @@ -57,7 +57,7 @@ { "id": "messages", "name": "Messages", - "version": "0.08", + "version": "0.09", "description": "App to display notifications from iOS and Gadgetbridge", "icon": "app.png", "type": "app", @@ -95,7 +95,7 @@ { "id": "ios", "name": "iOS Integration", - "version": "0.05", + "version": "0.06", "description": "(BETA) App to display notifications from iOS devices", "icon": "app.png", "tags": "tool,system,ios,apple,messages,notifications", diff --git a/apps/ios/ChangeLog b/apps/ios/ChangeLog index 5bafc4d98..28ad78dec 100644 --- a/apps/ios/ChangeLog +++ b/apps/ios/ChangeLog @@ -4,3 +4,4 @@ 0.04: Added common bundleId's 0.05: Added more bundleId's (app-id's which can be used to determine a friendly app name in the notifications) +0.06: Fix (not) popupping up old messages \ No newline at end of file diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 6e8c864a8..846ce93d3 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -26,6 +26,13 @@ E.on('ANCS',msg=>{ function ancsHandler() { var msg = Bangle.ancsMessageQueue[0]; NRF.ancsGetNotificationInfo( msg.uid ).then( info => { + + if(msg.preExisting){ + info.new = false; + } else { + info.new = true; + } + E.emit("notify", Object.assign(msg, info)); Bangle.ancsMessageQueue.shift(); if (Bangle.ancsMessageQueue.length) @@ -100,6 +107,7 @@ E.on('notify',msg=>{ t : msg.event, id : msg.uid, src : appNames[msg.appId] || msg.appId, + new : msg.new, title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) diff --git a/apps/messages/ChangeLog b/apps/messages/ChangeLog index 5c65b150d..84c5b7551 100644 --- a/apps/messages/ChangeLog +++ b/apps/messages/ChangeLog @@ -10,3 +10,4 @@ 0.07: Added settings menu with option to choose vibrate pattern and frequency (fix #909) 0.08: Fix rendering of long messages (fix #969) buzz on new message (fix #999) +0.09: Respect the 'new' attribute if it was set from iOS integrations \ No newline at end of file diff --git a/apps/messages/lib.js b/apps/messages/lib.js index 4593c8605..acfef536f 100644 --- a/apps/messages/lib.js +++ b/apps/messages/lib.js @@ -16,7 +16,11 @@ exports.pushMessage = function(event) { if (mIdx>=0) messages.splice(mIdx, 1); // remove item mIdx=-1; } else { // add/modify - if (event.t=="add") event.new=true; // new message + if (event.t=="add"){ + if(event.new === undefined ) { // If 'new' has not been set yet, set it + event.new=true; // Assume it should be new + } + } if (mIdx<0) { mIdx=0; messages.unshift(event); // add new messages to the beginning From cf604588bfde5bf292fa10f44f7e6f70a4e364bf Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Wed, 8 Dec 2021 02:06:15 +0100 Subject: [PATCH 27/30] Fix #968: messages app should not pop up with old messages --- apps/ios/boot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index 846ce93d3..bf14aeb07 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -27,7 +27,7 @@ E.on('ANCS',msg=>{ var msg = Bangle.ancsMessageQueue[0]; NRF.ancsGetNotificationInfo( msg.uid ).then( info => { - if(msg.preExisting){ + if(msg.preExisting === true){ info.new = false; } else { info.new = true; From f61d5c8d573eedc6545cd97124e23ab8c8178973 Mon Sep 17 00:00:00 2001 From: Jeroen Peters Date: Wed, 8 Dec 2021 02:22:06 +0100 Subject: [PATCH 28/30] Fix #968: messages app should not pop up with old messages --- apps/ios/boot.js | 2 ++ apps/messages/lib.js | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/ios/boot.js b/apps/ios/boot.js index bf14aeb07..d402facbb 100644 --- a/apps/ios/boot.js +++ b/apps/ios/boot.js @@ -56,6 +56,7 @@ E.on('notify',msg=>{ "message" : string, "messageSize" : string, "date" : string, + "new" : boolean, "posAction" : string, "negAction" : string, "name" : string, @@ -64,6 +65,7 @@ E.on('notify',msg=>{ "com.apple.facetime": "FaceTime", "com.apple.mobilecal": "Calendar", "com.apple.mobilemail": "Mail", + "com.apple.MobileSMS": "SMS Message", "com.apple.Passbook": "iOS Wallet", "com.apple.reminders": "Reminders", "com.apple.shortcuts": "Shortcuts", diff --git a/apps/messages/lib.js b/apps/messages/lib.js index acfef536f..586a82b67 100644 --- a/apps/messages/lib.js +++ b/apps/messages/lib.js @@ -1,6 +1,6 @@ exports.pushMessage = function(event) { /* event is: - {t:"add",id:int, src,title,subject,body,sender,tel, important:bool} // add new + {t:"add",id:int, src,title,subject,body,sender,tel, important:bool, new:bool} // add new {t:"add",id:int, id:"music", state, artist, track, etc} // add new {t:"remove-",id:int} // remove {t:"modify",id:int, title:string} // modified @@ -31,7 +31,11 @@ exports.pushMessage = function(event) { // if in app, process immediately if (inApp) return onMessagesModified(mIdx<0 ? {id:event.id} : messages[mIdx]); // ok, saved now - we only care if it's new - if (event.t!="add") return; + if (event.t!="add") { + return; + } else if(event.new == false) { + return; + } // otherwise load messages/show widget var loadMessages = Bangle.CLOCK || event.important; // first, buzz From 1d2f3c049dcb1df25e204db3dbb435cce82436bd Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Wed, 8 Dec 2021 08:30:06 +0100 Subject: [PATCH 29/30] Bump version --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 13bb5892d..23bc9ebf3 100644 --- a/apps.json +++ b/apps.json @@ -1126,7 +1126,7 @@ { "id": "qrcode", "name": "Custom QR Code", - "version": "0.02", + "version": "0.03", "description": "Use this to upload a customised QR code to Bangle.js", "icon": "app.png", "tags": "qrcode", From aa94abe3befe36085d4e8ab69713c312ba076cef Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Wed, 8 Dec 2021 10:13:42 +0000 Subject: [PATCH 30/30] tweaks to allow lint to pass after #1019 --- apps/scribble/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/scribble/app.js b/apps/scribble/app.js index 3d05f68c5..99ee3f717 100644 --- a/apps/scribble/app.js +++ b/apps/scribble/app.js @@ -12,7 +12,7 @@ const transp = -1; const abc = "abcdefghijklmnopqrstuvwxyz1234567890"; // const abc_up = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; const uppercase = 1; -const last_layer = false; // set to true at the last layer of the tree +var last_layer = false; // set to true at the last layer of the tree let chunk_size = 6; const font_height = 2; @@ -156,7 +156,7 @@ class Layer { class BTN_layer extends Layer { constructor(label, layout) { - + super(); Layer.call(this, label) this.alphabet = (uppercase) ? abc.toUpperCase() : abc; @@ -466,4 +466,4 @@ Bangle.on('swipe', function (direction) { g.clear(); // Start ticking -tick(); \ No newline at end of file +tick();