diff --git a/apps/ac_ac/Customizer.html b/apps/ac_ac/Customizer.html new file mode 100644 index 000000000..cc8e21d1f --- /dev/null +++ b/apps/ac_ac/Customizer.html @@ -0,0 +1,890 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + ++ Please customize your analog clock for the Bangle.js 2 according to your needs. + When finished, click on "Upload" at the bottom of this form. +
+ (Pressing "Upload" will also backup your current configuration so that you + won't have to enter the same settings over and over again when you come back + to this page later) +
+ ++ Click on the desired clock size calculator (if you installed some widgets + on your Bangle.js 2, the smart one may produce larger clock faces than the + simple one): +
+
|
+ + simple + |
+
+
+ + smart + |
+
+
+ + (custom) + |
+
+ If you prefer a "custom" clock size calculator, please enter the URL + of its JavaScript module below: +
+ custom URL: +
+ ++ Click on the desired clock face: +
+
|
+ + none + |
+
+
+ + four-fold + |
+
+
+ + twelve-fold + |
+
+
+ + "rainbow" colored + |
+
+
+ + (custom) + |
+
+ Clock faces are drawn in the configured foreground and background colors + (you may select them at the end of this form) +
+ "Four-fold" clock faces may draw indian-arabic or roman numerals. Which do you prefer? +
+ indian-arabic (3, 6, 9, 12)
+ roman (III, VI, IX, XII)
+
+ The "twelve-fold" and "rainbow"-colored faces may be drawn with or without + dots marking the position of every minute. Which variant do you prefer? +
+ without dots
+ with dots
+
+ If you prefer a "custom" clock face, please enter the URL + of its JavaScript module below: +
+ custom URL: +
+ ++ Click on the desired clock hands: +
+
|
+ + simple + |
+
+
+ + rounded + |
+
+
+ + hollow + |
+
+
+ + (custom) + |
+
+ Clock hands are drawn in the configured foreground and background colors + (you may select them at the end of this form) +
+ Hollow clock hands may optionally be filled with a given color. If you have + chosen hollow hands, please specify the desired fill mode and color below: +
+ Hollow Hand Fill Color: +
+ + + + + + + + + + +
+ Additionally, all clock hands may be drawn with or without second hands. + If you want them to be drawn, please click on their desired color below + (or choose "themed" to use your Bangle's configured theme) - if not, just + select "none": +
+ Second Hand Color: +
+ + + + + + + + + + +
+ If you prefer "custom" clock hands, please enter the URL + of their JavaScript module below: +
+ custom URL: +
+ ++ Complications are small displays for additional information. If you want + one or multiple complications to be added to your clock, you'll have to + specify which one to be loaded and where it should be placed. +
+ Up to 6 possible positions exist (top-left, top-right, left, right, + bottom-left and bottom-right). Alternatively, the positions "top-left" and + "top-right" may be traded for a slightly larger complication at position + "top" or "bottom-left" and "bottom-right" for one at the "bottom": +
+
+
++
| top-left: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| top: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| top-right: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| left: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| right: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| bottom-left: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| bottom: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
| bottom-right: | +||
| + | Complication: | ++ + | +
| + | custom URL: | ++ |
+ Color faces, hands and complications are often drawn using configurable + foreground and background colors. +
+ Here you may specify these colors. Click on a color to select it - or on + "themed" if you want the clock to use the currently configured theme on + your Bangle.js 2: +
+ Background Color: +
+ + + + + + + + + +
+ Foreground Color: +
+ + + + + + + + + +
+ When you are satisfied with your configuration, just click on "Upload" in + order to generate the specified clock and upload it to your Bangle.js 2: +
+ + + ++ This application is based on the author's + Analog Clock Construction Kit (ACCK). + If you need a different "clockwork", clock size calculation or clock face, + or specific clock hands or complications, just follow the link to learn how to + implement your own clock parts. +
+ + + diff --git a/apps/ac_ac/README.md b/apps/ac_ac/README.md new file mode 100644 index 000000000..05e5f4798 --- /dev/null +++ b/apps/ac_ac/README.md @@ -0,0 +1,34 @@ +# AC-AC - A Configurable Analog Clock # + +This app implements an analog clock with various faces, hands and complications +to choose from before uploading to a Bangle.js 2. + +It is based on the [Analog Clock Construction Kit (ACCK)](https://github.com/rozek/banglejs-2-analog-clock-construction-kit) +and makes most of the currently implemented parts available with a few mouse +clicks - just click on "Upload" and you will be directed to a web form where +you compose your very own, personal analog clock. + +You currently have the choice between + +* 2 different clock sizes, +* 4 different clock faces, +* 3 different clock hands and +* 4 different complications + +Alternatively, you may specify the GitHub URL of ACCK compatible modules for +external clock sizes, faces, hands or complications. + +Additionally, you may use the currently configured global theme or configure +your own colors for clock fore- and background and second hands. + +Consequently, even without external modules you already have the choice between +102144 combinations! + + + +## License ## + +[MIT License](LICENSE) diff --git a/apps/ac_ac/RainbowClockFace.png b/apps/ac_ac/RainbowClockFace.png new file mode 100644 index 000000000..2defa759b Binary files /dev/null and b/apps/ac_ac/RainbowClockFace.png differ diff --git a/apps/ac_ac/app-icon.js b/apps/ac_ac/app-icon.js new file mode 100644 index 000000000..20caf2c8e --- /dev/null +++ b/apps/ac_ac/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwgn/ABH+AQPvBpIAI/n8/3f5/PCp/v9oHF7w1CABffGxAYMH4f9z/514YDCxW/O4gFBxwHD/ZEL7/9GgX8GwQLCBQQXH/uP/Hf/2N44IBAgIXJ7oaD/3v/3uAYIIB9wQGAA2+/iRG5oSIM4f+1nrPYgAB3aHIAC77QYYRoCAAP676ICABXYFIntDoPf3+PC5f+BoPOX4vPNBn7IogEB/eu3QXC9wNEAAeKBIP+dgbSCDYMwgEApQVEygPCeRH8iAWBAAMHPwXDgoRGAonACwYABgN5uMAC4q8GC4U0DQsAggRF9gXFgggB/2hC4kdVAQCBVAX7xwXCVAnGCwUadAeeDYfr7IhEAAf93e+A4gpB9yRB/mqcgndRgQAHzqRE1gEC/KoCjLZEsgCB9evO4gOC/RyEgqdC2KnFO4S/KgFYsC/Ga5EBs1AX5bXHgx1C2YXEnp7GCARgB4AfE64WCnawFCgf9VAK/G/3M7zWDz4PF/maXJIAD7D8EVAP85QXN3OP/42DfoQXN/wvE/ySGABa8FAC37AgepVwQ9E1SfBAAJIEAAnrBQ39xgwJ7pRHFQX+3QECCAbyG9bPDzwXC9QMBdgQXIAAf41wEC5pLCJJBcF9fZQ5IAGYYn81q7RJQwWC/wXM9/tA4veCxooDIAPv55PEABwpB97rDAAw")) \ No newline at end of file diff --git a/apps/ac_ac/app-icon.png b/apps/ac_ac/app-icon.png new file mode 100644 index 000000000..b83541133 Binary files /dev/null and b/apps/ac_ac/app-icon.png differ diff --git a/apps/ac_ac/app-screenshot.png b/apps/ac_ac/app-screenshot.png new file mode 100644 index 000000000..0aef3fa38 Binary files /dev/null and b/apps/ac_ac/app-screenshot.png differ diff --git a/apps/ac_ac/app.js b/apps/ac_ac/app.js new file mode 100644 index 000000000..1d9b2e3c6 --- /dev/null +++ b/apps/ac_ac/app.js @@ -0,0 +1,2 @@ +let Clockwork = require('https://raw.githubusercontent.com/rozek/banglejs-2-simple-clockwork/main/Clockwork.js'); +Clockwork.windUp(); \ No newline at end of file diff --git a/apps/ac_ac/custom.png b/apps/ac_ac/custom.png new file mode 100644 index 000000000..14d797ba3 Binary files /dev/null and b/apps/ac_ac/custom.png differ diff --git a/apps/ac_ac/fourfoldClockFace.png b/apps/ac_ac/fourfoldClockFace.png new file mode 100644 index 000000000..391303b31 Binary files /dev/null and b/apps/ac_ac/fourfoldClockFace.png differ diff --git a/apps/ac_ac/hollowClockHands.png b/apps/ac_ac/hollowClockHands.png new file mode 100644 index 000000000..2dce42ef5 Binary files /dev/null and b/apps/ac_ac/hollowClockHands.png differ diff --git a/apps/ac_ac/largePlaceholders.png b/apps/ac_ac/largePlaceholders.png new file mode 100644 index 000000000..b7272e57c Binary files /dev/null and b/apps/ac_ac/largePlaceholders.png differ diff --git a/apps/ac_ac/metadata.json b/apps/ac_ac/metadata.json new file mode 100644 index 000000000..a4f3de0ac --- /dev/null +++ b/apps/ac_ac/metadata.json @@ -0,0 +1,18 @@ +{ "id": "ac_ac", + "name": "A Configurable Analog Clock", + "shortName":"Configurable Clock", + "version":"0.03", + "description": "AC-AC, a highly customizable analog clock with several clock faces, hands and complications to choose from", + "icon": "app-icon.png", + "type": "clock", + "tags": "clock", + "supports" : ["BANGLEJS2"], + "allow_emulator": false, + "screenshots": [{"url":"app-screenshot.png"}], + "readme": "README.md", + "custom": "Customizer.html", + "storage": [ + {"name":"ac_ac.app.js","url":"app.js"}, + {"name":"ac_ac.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/ac_ac/none.png b/apps/ac_ac/none.png new file mode 100644 index 000000000..6f8d8ae14 Binary files /dev/null and b/apps/ac_ac/none.png differ diff --git a/apps/ac_ac/roundedClockHands.png b/apps/ac_ac/roundedClockHands.png new file mode 100644 index 000000000..cbd48e856 Binary files /dev/null and b/apps/ac_ac/roundedClockHands.png differ diff --git a/apps/ac_ac/simpleClockHands.png b/apps/ac_ac/simpleClockHands.png new file mode 100644 index 000000000..820606f27 Binary files /dev/null and b/apps/ac_ac/simpleClockHands.png differ diff --git a/apps/ac_ac/simpleClockSize.png b/apps/ac_ac/simpleClockSize.png new file mode 100644 index 000000000..49650586e Binary files /dev/null and b/apps/ac_ac/simpleClockSize.png differ diff --git a/apps/ac_ac/smallPlaceholders.png b/apps/ac_ac/smallPlaceholders.png new file mode 100644 index 000000000..43569e56d Binary files /dev/null and b/apps/ac_ac/smallPlaceholders.png differ diff --git a/apps/ac_ac/smartClockSize.png b/apps/ac_ac/smartClockSize.png new file mode 100644 index 000000000..6891acc89 Binary files /dev/null and b/apps/ac_ac/smartClockSize.png differ diff --git a/apps/ac_ac/twelvefoldClockFace.png b/apps/ac_ac/twelvefoldClockFace.png new file mode 100644 index 000000000..fc04d865e Binary files /dev/null and b/apps/ac_ac/twelvefoldClockFace.png differ diff --git a/apps/accelgraph/ChangeLog b/apps/accelgraph/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/accelgraph/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/accelgraph/app-icon.js b/apps/accelgraph/app-icon.js new file mode 100644 index 000000000..d45b8cc63 --- /dev/null +++ b/apps/accelgraph/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4UA/4AB304ief85L/ABNVAAwKCgILHoALBgoLHqALOrVVr4BEBZIFBBYiaCAAPq2oLQEYlqF5VrBZWnBZWvBZNWz4LGBoQLHJ4O///6v/1BZHa/4LFLYOlr9pR49r1ILJ09qr4ZBBY2vrWdBY5PBq2uyoLIquqBY5bBKoZTFLYILJJ4STDBY77IJ4QLUJ4QLU1QAE0oLPqoAGBZ0BBY9ABYMABY4KCAH4AGA=")) diff --git a/apps/accelgraph/app.js b/apps/accelgraph/app.js new file mode 100644 index 000000000..a59d636d2 --- /dev/null +++ b/apps/accelgraph/app.js @@ -0,0 +1,24 @@ +Bangle.loadWidgets(); +g.clear(1); +Bangle.drawWidgets(); +var R = Bangle.appRect; + +var x = 0; +var last; + +function getY(v) { + return (R.y+R.y2 + v*R.h/2)/2; +} +Bangle.on('accel', a => { + g.reset(); + if (last) { + g.setColor("#f00").drawLine(x-1,getY(last.x),x,getY(a.x)); + g.setColor("#0f0").drawLine(x-1,getY(last.y),x,getY(a.y)); + g.setColor("#00f").drawLine(x-1,getY(last.z),x,getY(a.z)); + } + last = a;x++; + if (x>=g.getWidth()) { + x = 1; + g.clearRect(R); + } +}); diff --git a/apps/accelgraph/app.png b/apps/accelgraph/app.png new file mode 100644 index 000000000..b0ba00ee7 Binary files /dev/null and b/apps/accelgraph/app.png differ diff --git a/apps/accelgraph/metadata.json b/apps/accelgraph/metadata.json new file mode 100644 index 000000000..e4c1ae0a5 --- /dev/null +++ b/apps/accelgraph/metadata.json @@ -0,0 +1,14 @@ +{ "id": "accelgraph", + "name": "Accelerometer Graph", + "shortName":"Accel Graph", + "version":"0.01", + "description": "A simple app to draw a graph of data from the accelerometer on the screen", + "icon": "app.png", + "tags": "tool,debug", + "supports" : ["BANGLEJS","BANGLEJS2"], + "screenshots": [{"url":"screenshot.png"}], + "storage": [ + {"name":"accelgraph.app.js","url":"app.js"}, + {"name":"accelgraph.img","url":"app-icon.js","evaluate":true} + ] +} diff --git a/apps/accelgraph/screenshot.png b/apps/accelgraph/screenshot.png new file mode 100644 index 000000000..404243d85 Binary files /dev/null and b/apps/accelgraph/screenshot.png differ diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index c2c4ea6be..0d837fe43 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -4,3 +4,4 @@ 0.03: Handling of message actions (ok/clear) 0.04: Android icon now goes to settings page with 'find phone' 0.05: Fix handling of message actions +0.06: Option to keep messages after a disconnect (default false) (fix #1186) diff --git a/apps/android/README.md b/apps/android/README.md new file mode 100644 index 000000000..c10718aac --- /dev/null +++ b/apps/android/README.md @@ -0,0 +1,48 @@ +# Android Integration + +This app allows your Bangle.js to receive notifications [from the Gadgetbridge app on Android](http://www.espruino.com/Gadgetbridge) + +See [this link](http://www.espruino.com/Gadgetbridge) for notes on how to install +the Android app (and how it works). + +It requires the `Messages` app on Bangle.js (which should be automatically installed) to +display any notifications that are received. + +## Settings + +You can access the settings menu either from the `Android` icon in the launcher, +or from `App Settings` in the `Settings` menu. + +It contains: + +* `Connected` - shows whether there is an active Bluetooth connection or not +* `Find Phone` - opens a submenu where you can activate the `Find Phone` functionality +of Gadgetbridge - making your phone make noise so you can find it. +* `Keep Msgs` - default is `Off`. When Gadgetbridge disconnects, should Bangle.js +keep any messages it has received, or should it delete them? +* `Messages` - launches the messages app, showing a list of messages + +## How it works + +Gadgetbridge on Android connects to Bangle.js, and sends commands over the +BLE UART connection. These take the form of `GB({ ... JSON ... })\n` - so they +call a global function called `GB` which then interprets the JSON. + +Responses are sent back to Gadgetbridge simply as one line of JSON. + +More info on message formats on http://www.espruino.com/Gadgetbridge + +## Testing + +Bangle.js can only hold one connection open at a time, so it's hard to see +if there are any errors when handling Gadgetbridge messages. + +However you can: + +* Use the `Gadgetbridge Debug` app on Bangle.js to display/log the messages received from Gadgetbridge +* Connect with the Web IDE and manually enter the Gadgetbridge messages on the left-hand side to +execute them as if they came from Gadgetbridge, for instance: + +``` +GB({"t":"notify","id":1575479849,"src":"Hangouts","title":"A Name","body":"message contents"}) +``` diff --git a/apps/android/boot.js b/apps/android/boot.js index 59ffe006d..fff9ad444 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -4,6 +4,7 @@ Bluetooth.println(JSON.stringify(message)); } + var settings = require("Storage").readJSON("android.settings.json",1)||{}; var _GB = global.GB; global.GB = (event) => { // feed a copy to other handlers if there were any @@ -51,7 +52,8 @@ // Battery monitor function sendBattery() { gbSend({ t: "status", bat: E.getBattery() }); } NRF.on("connect", () => setTimeout(sendBattery, 2000)); - NRF.on("disconnect", () => require("messages").clearAll()); // remove all messages on disconnect + if (!settings.keep) + NRF.on("disconnect", () => require("messages").clearAll()); // remove all messages on disconnect setInterval(sendBattery, 10*60*1000); // Health tracking Bangle.on('health', health=>{ @@ -68,4 +70,6 @@ if (isFinite(msg.id)) return gbSend({ t: "notify", n:response?"OPEN":"DISMISS", id: msg.id }); // error/warn here? }; + // remove settings object so it's not taking up RAM + delete settings; })(); diff --git a/apps/android/metadata.json b/apps/android/metadata.json index edfc0a5f2..6b780ff55 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,17 +2,19 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.05", + "version": "0.06", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "icon": "app.png", - "tags": "tool,system,messages,notifications", + "tags": "tool,system,messages,notifications,gadgetbridge", "dependencies": {"messages":"app"}, "supports": ["BANGLEJS","BANGLEJS2"], + "readme": "README.md", "storage": [ {"name":"android.app.js","url":"app.js"}, {"name":"android.settings.js","url":"settings.js"}, {"name":"android.img","url":"app-icon.js","evaluate":true}, {"name":"android.boot.js","url":"boot.js"} ], + "data": [{"name":"android.settings.json"}], "sortorder": -8 } diff --git a/apps/android/settings.js b/apps/android/settings.js index d241397a4..7c46a1fc0 100644 --- a/apps/android/settings.js +++ b/apps/android/settings.js @@ -2,17 +2,29 @@ function gb(j) { Bluetooth.println(JSON.stringify(j)); } + var settings = require("Storage").readJSON("android.settings.json",1)||{}; + function updateSettings() { + require("Storage").writeJSON("android.settings.json", settings); + } var mainmenu = { "" : { "title" : "Android" }, "< Back" : back, - "Connected" : { value : NRF.getSecurityStatus().connected?"Yes":"No" }, + /*LANG*/"Connected" : { value : NRF.getSecurityStatus().connected?"Yes":"No" }, "Find Phone" : () => E.showMenu({ "" : { "title" : "Find Phone" }, "< Back" : ()=>E.showMenu(mainmenu), - "On" : _=>gb({t:"findPhone",n:true}), - "Off" : _=>gb({t:"findPhone",n:false}), + /*LANG*/"On" : _=>gb({t:"findPhone",n:true}), + /*LANG*/"Off" : _=>gb({t:"findPhone",n:false}), }), - "Messages" : ()=>load("messages.app.js") + /*LANG*/"Keep Msgs" : { + value : !!settings.keep, + format : v=>v?/*LANG*/"Yes":/*LANG*/"No", + onchange: v => { + settings.keep = v; + updateSettings(); + } + }, + /*LANG*/"Messages" : ()=>load("messages.app.js") }; E.showMenu(mainmenu); }) diff --git a/apps/antonclk/ChangeLog b/apps/antonclk/ChangeLog index fdf20c175..4dca8053e 100644 --- a/apps/antonclk/ChangeLog +++ b/apps/antonclk/ChangeLog @@ -4,4 +4,7 @@ 0.04: Clock can optionally show seconds, date optionally in ISO-8601 format, weekdays and uppercase configurable, too. 0.05: Clock can optionally show ISO-8601 calendar weeknumber (default: Off) when weekday name "Off": week #:GPS can take a long time (~5 minutes) to get an accurate position the first time it is used. AGPS uploads a few hints to the GPS receiver about satellite positions that allow it to get a faster, more accurate fix - however they are only valid for a short period of time.
-You can upload data that covers a longer period of time, but the upload will take longer.
-Click
+ +