From ce0e50ed949eeffc97bd2ec3db1fdb38830c3e4e Mon Sep 17 00:00:00 2001 From: hughbarney Date: Fri, 26 Nov 2021 20:25:28 +0000 Subject: [PATCH 01/39] MyLocation - adds menu to set preferred city or setup from GPS --- apps.json | 15 +++++ apps/mylocation/ChangeLog | 1 + apps/mylocation/README.md | 44 +++++++++++++++ apps/mylocation/mylocation.png | Bin 0 -> 1909 bytes apps/mylocation/mylocation.settings.js | 73 +++++++++++++++++++++++++ apps/mylocation/screenshot_1.png | Bin 0 -> 2847 bytes apps/mylocation/screenshot_2.png | Bin 0 -> 2642 bytes apps/mylocation/screenshot_3.png | Bin 0 -> 15562 bytes apps/mylocation/screenshot_4.png | Bin 0 -> 2818 bytes apps/pastel/pastel.app.js | 30 ++++++++++ 10 files changed, 163 insertions(+) create mode 100644 apps/mylocation/ChangeLog create mode 100644 apps/mylocation/README.md create mode 100644 apps/mylocation/mylocation.png create mode 100644 apps/mylocation/mylocation.settings.js create mode 100644 apps/mylocation/screenshot_1.png create mode 100644 apps/mylocation/screenshot_2.png create mode 100644 apps/mylocation/screenshot_3.png create mode 100644 apps/mylocation/screenshot_4.png diff --git a/apps.json b/apps.json index a7a74f4cb..8b1fb586e 100644 --- a/apps.json +++ b/apps.json @@ -4456,5 +4456,20 @@ "storage": [ {"name":"timecal.app.js","url":"timecal.app.js"} ] + }, + { "id": "mylocation", + "name": "My Location", + "shortName":"My Location", + "icon": "mylocation.png", + "screenshots": [{"url":"screenshot_1.png"}], + "version":"0.01", + "description": "My Locations adds a menu in the Settings app to set your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", + "readme": "README.md", + "tags": "tool,utility", + "type": "app", + "supports": ["BANGLEJS", "BANGLEJS2"], + "storage": [ + {"name":"mylocation.settings.js","url":"mylocation.settings.js"} + ] } ] diff --git a/apps/mylocation/ChangeLog b/apps/mylocation/ChangeLog new file mode 100644 index 000000000..7b83706bf --- /dev/null +++ b/apps/mylocation/ChangeLog @@ -0,0 +1 @@ +0.01: First release diff --git a/apps/mylocation/README.md b/apps/mylocation/README.md new file mode 100644 index 000000000..3b39aa947 --- /dev/null +++ b/apps/mylocation/README.md @@ -0,0 +1,44 @@ +# My Location + + *a adds a My Location settings menu, stores GPS lat and lon of your preferred city* + +* My Location is a service app that adds a 'My Location' menu to the settings menu +* Select one of the preset Cities or setup through the GPS +* Other Apps can read this information to do calculations based on location +* When the City shows ??? it means the location has been set through the GPS + +## Example Code + + const LOCATION_FILE = "mylocation.json"; + let location; + + // requires the myLocation app + function loadLocation() { + location = require("Storage").readJSON(LOCATION_FILE,1)||{"lat":51.5072,"lon":0.1276,"location":"London"}; + } + +## Screenshots + +### Select one of the Preset Cities + +* The presets are London, Newcastle, Edinbrough, Paris, New York, Tokyo + +![](screenshot_1.png) + +### Or select 'Set By GPS' to start the GPS + +![](screenshot_2.png) + +### While the GPS is running you will see: + +![](screenshot_3.png) + +### When a GPS fix is received you will see: + +![](screenshot_4.png) + + + +## Creator + +[Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/) diff --git a/apps/mylocation/mylocation.png b/apps/mylocation/mylocation.png new file mode 100644 index 0000000000000000000000000000000000000000..7148990a42a1c8858d933d2a4cb35b80123a5505 GIT binary patch literal 1909 zcmV-*2a5QKP)1f{oIeq9#IX zOf{({O-*cUKk%VRxp+%YMPU&efj|3B}%Gtc{uFh$VRFTVr&05N+hmOTqw5{SsK zRq^~hp6S9jhcVu7mJ0i>}op)z!;xQ{&^&`R#GVwH9WEaeQfJ>BoptFh|R8ypn@@g4s~Z+ zAOYPL+%Al}QXb#%&nSE%3DC#3-bG{mOV}Y--E|?8ANqHT!{ow5VmbiFlKYm+Yg=}jras6GBg@72L>|d5wlEoY`!pQ*klg6p{<$e z$#!B+vczB%x_gHNTpqkfI)1CXn97GaO}wJx(crv3fxPd-g^QPyJirPX+zpdCg^qxx z+HRqt@!gU}&xek#ArY4!IV}HL*|GI}Ifw8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zmiO?o`St$_bFBEXobD{%;>7Hq#T{;TET&slX{Z98uXqMLqxi%Bc~>b^wn3H#4hy{I ziTBF#1@-@~B&e!Qn=`6)^!VSkExB1lz9JT_7Bt(I)LTMa1WN!BB;y)72K)iQ2g!hT vfnGqRQ;-viIVr;N(+lDs-76CL)93#HbI`dUZ#9t@00000NkvXXu0mjf9c-jw literal 0 HcmV?d00001 diff --git a/apps/mylocation/mylocation.settings.js b/apps/mylocation/mylocation.settings.js new file mode 100644 index 000000000..6936e9e69 --- /dev/null +++ b/apps/mylocation/mylocation.settings.js @@ -0,0 +1,73 @@ +(function(back) { + const SETTINGS_FILE = "mylocation.json"; + + // initialize with default settings... + let s = { + 'lat': 51.5072, + 'lon': 0.1276, + 'location': "London" + } + + // ...and overwrite them with any saved values + // This way saved values are preserved if a new version adds more settings + const storage = require('Storage') + let settings = storage.readJSON(SETTINGS_FILE, 1) || {} + const saved = settings || {} + for (const key in saved) { + s[key] = saved[key] + } + + function save() { + settings = s + storage.write(SETTINGS_FILE, settings) + } + + const locations = ["London", "Newcastle", "Edinburgh", "Paris", "New York", "Tokyo","???"]; + const lats = [51.5072 ,54.9783 ,55.9533 ,48.8566 ,40.7128 ,35.6762, 0.0]; + const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; + + E.showMenu({ + '': { 'title': 'My Location' }, + '< Back': back, + 'City': { + value: 0 | locations.indexOf(s.location), + min: 0, max: 6, + format: v => locations[v], + onchange: v => { + if (v != 6) { + s.location = locations[v]; + s.lat = lats[v]; + s.lon = lons[v]; + save(); + } + }, + }, + 'Set From GPS': ()=>setFromGPS() + }) + + function setFromGPS() { + console.log("set from GPS"); + Bangle.setGPSPower(1); + E.showMessage("Waiting for GPS fix. Place watch in the open. Could take 10 minutes. Long press to abort", "GPS Running"); + Bangle.setUI("updown", undefined); + } + + Bangle.on('GPS', (gps) => { + //console.log("."); + if (gps.fix === 0) return; + //console.log("fix from GPS"); + s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } + Bangle.buzz(1500); // buzz on first position + Bangle.setGPSPower(0); + save(); + + Bangle.setUI("updown", ()=>{ load() }); + E.showPrompt("Location has been saved from the GPS fix",{ + title:"Location Saved", + buttons : {"OK":1} + }).then(function(v) { + load(); // load default clock + }); + }); + +}) diff --git a/apps/mylocation/screenshot_1.png b/apps/mylocation/screenshot_1.png new file mode 100644 index 0000000000000000000000000000000000000000..a9c61b6b35272dabcd77f7262d0ae6a2e9099057 GIT binary patch literal 2847 zcmeHJX*`sT9(`tdj6tJeh#^Z^do88mZD>N4QI)x;T<^E+#aA~Xs}2G@$ZgN9v2Y>jlqEg*DD`m%hRa;pL!7t{o6EBwJva6|zJI&ao4NFi8B2XU@d}{= zp^OCpEOgwB$x!Dv<8+vdo+`;DVb(U%`kx4sX_dY85{s(6|Th2LvD>&(-3GSCz) z5HCz4o0oLfU1=p%E76aq4(hkxcl4j}FOM5ilTpu>I1-2N#=}LG^=rR1`(H4!ps$;3 z)&KHGxMe{7N-esDREc7VlZqs#U&W(BbHvZB^M6H#Z(&1iHU?i{G5zi3qOrg@e@mZN z7C>M;_6qu;Ov=@ov5X?!ZYienws0{MHMK~}$$NJ;J|zKu3a!7(kxSHvigBmS4KNU8 zahM-9B5L|cuCjm^wd;|oI)|Dw$@=&~Dn;=YR4!_?q)4iDTe%2!Akl7%3scBK4bqXI zPKbPW5+8jiP^TrLD6i*6GT=(t=i?`93*u7;4`zyT)9Sy8n9_gIWX?`k0;yxL%2ljV z>H#HT7q<6d$GE4d9=vq@f%WTzIVwH1@HF|20yHl7-chDXrfB>0l@V(Xnqc}1g|Kcj zx5CW$^JCp^I#HJ7a3L@ZosecKx1b`zKHW$1tyY z{05Vg_9{TCM$J5shE@YhzfDTHXoXqyM41sC6P8(*raDSF>TR=)`QVx|UE`@{Y!cvl zy;$39Kq_{Fv6BBPOS(Kv{oUuXR#RTOuJ-Zl%JrTDWszD&tG`?5ijukS>!<`Vf9-s) z%L5}$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GZ-3t7GtKhs~+cqL&x)7(gfyoVw9o5mQ04`Z2(3VqmY8Fz~B6huf^CEAt#x; Pix)U!N-|*?xyAkq*A-bw literal 0 HcmV?d00001 diff --git a/apps/mylocation/screenshot_2.png b/apps/mylocation/screenshot_2.png new file mode 100644 index 0000000000000000000000000000000000000000..4c4404540ffebeec33f1a4dbdcdd560d25fbf936 GIT binary patch literal 2642 zcmeHJ`#;l-7oU&G$iu8uQm&1jgrv(Jxg~d%9#3SO%Q8%+2xYdpOv)v!DYpzI)%WW* znIRcVM2SV&a*2J7q-|}5nWxmFKjQoS>3d$UbI$91Ugw8%-sg2*uXpyTlkUH%Z&wF_ zK)-oXdYTX{DIX@@v(?yeSo-tz zdn?Jv{mtkCi#0@;{1ZKN7wG`v`Rk=GzbrEqO867d0;deW9G3V1kX(q>2@oZuoh(ZD z@r7{f@&ne0tH4(*)$Tw|<;|4#K)&ne7v{%pYKwBbv$gB@SW!*X$+0P&${tmeJOj|r3?$L!4T(_Rs^4Mg7Oni$!3J(Bdv2PFT%4{W(F;k; zrHc5(4K3<33(@9d$Y^j&79(|1m=P%WXz9Y!IA^g$O)5!ZY@LJ=(8>nIP5f;js;Fbb|n{LHB zrsVaP>#o+TFXWrZ@>wh0PMGpL{-&d_^x~vCuUK*x2+%q!toDNtij$aY;TtO8{i`Q{ zQP`sMk+1IyKvvDuO?6V6-Qbi;)O1`mggnsH$-M(rBu6C=(1Q2Giq^O$=VFfdT&-Ez zYoEOByl~;k!@n3g;Tbj3~MqIgFV)hLxrQ759}r-RmDZeIG6)k&~z?b#|j;aYQVUaKDU~Ta4V_cK-Xcch~rsBHQ zcqaDS*mqLj2k{sIH{+jsMv0W0mT>t52592=sZ*ZrFfW~?NpZVcX#nNCF1^a7? z6m2qa|FIC;*y1Sz^>Tmwr_4fMmoO@+WnB`t{$4);jqay zCXV>5R$Ale?|J z*xk)Bo8~Pj=9m}<%e+RJzzX@QTHB!knYCcbVKSK;ENKWxOvru zLZW!d@Om2A;9Y_FF$}(lo9<2*sr6U(gsVrtxG>kQ?`U5FkA3k3N(;K~kCrwl!?=5z zaQ!|7mX8M13}gQY zg`I{u3B1~SEX`v7w(POSOW}+C8|~)q8Buc6aQJx9alZ+!#mKzq7MtxWy^>+_hrVHd zV1Zc<;?Gg}w;5T7)+A|Xfo{NO?tQiT>=(q2F6sBk2?J|4m6qKoW!BKV;x@RhJ>N?= zTW^a(Tr-yPVHG>l*K)5sh*>Qit@V)9jGt5^2bNIx8W}5-tn7nH&Hh2?0ag6l_r+ay z-dRkrKh7kEeo;BHFm_E?q^0vUMe6KQV57{iy4jwoo!T^^`P08?R67F0a^uf3?f!K; zsmsi_2+H65!xE{js4mdnov2N@n5!LYVbo+07LbnW>$~<6nYb&BlUP?1dz|*-L6szY zoqKM7ju* zvH-IAXr9NTeM;cqHblapX(OHUs`K)2sXDN6{fn+% zKgN#+994d_uE<5rjF7UjZ>_!gJyFZ^EBaG`)2DGH1q$mRoX@V^ehgqZIH)c+RCsn-8>YCi8^9t1e*ku&Et2^~6_IWCx0k zEmp@A&l~!PzpQ~5`vEvA_9;OKka$5RqQ~~TYGv#eo3#ms4X#fn7QRB{kGO<|oN5zW z=Be2=ea_i@Q7?R!9(k6HMYLT1a8wYDOYLFC%n)syX0eXO!d%Y8WA=N^S}S``l5?w9 z_}pU3CzlH|UM!>;fvh*U=UQUK;=U|0SvrA2U!qwDbfX@jY-D5aD%SFIR|$6wN>MxP z4hD4Otr;jJGH0 z$EfkgZKIa0eKS1JcnzG-OiLv)eTC3^A&sbAIsJazTUjYGK?&UE@ zyuh93&rM@7>jL3Yr)0O)xBA%$SUAQPfb8u((G(3p=qGLw{*V5bOr$EkXP_#pj;2kn Pi$sv8>q(aeXH5D(w(Zo_ literal 0 HcmV?d00001 diff --git a/apps/mylocation/screenshot_3.png b/apps/mylocation/screenshot_3.png new file mode 100644 index 0000000000000000000000000000000000000000..81570670b7988aa92f6e6fedc007c5bedc2a387d GIT binary patch literal 15562 zcmeHL%W~sJ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4)Tc*E^pV^y_yIV>>h26<_5@zwr2+cl`H_kX>>=F7LB=ONaELox)OiA{G0{8v3gXkt{Fs zg3tcBUXubwsUEdIQdxfJy?k7($#Zy1FSSbX@GdP|Eb6sByk{Sd+dZx uGlus8FYwx9qjPmTbG8`H#n5hV$-NiTxw?HXXNzyv_epd!#}*;qB<4S8=}L+K literal 0 HcmV?d00001 diff --git a/apps/mylocation/screenshot_4.png b/apps/mylocation/screenshot_4.png new file mode 100644 index 0000000000000000000000000000000000000000..ffae679c9dd8828f966f5873891f1d6e51961248 GIT binary patch literal 2818 zcmb_ec~sKd7CxY4{mkr^SeZ*L8&tB)@)H35+A25+HrnOP)Y)z=&5@ z$7ZbWSc$(Bus{GtP)n={UP~thYSJ%a8*av{mO>l4!sKhwj(pY+Tr~lFS_K;p>Y|rA z*D1-hT3Q92<8V2y+u_~fMT$0(=(wJr^XA)^GX{WRtxXx_LE%y+^WhJH`HQNUa_^Xa z6XEX{R?fD<7Mz`66hpxo+JN`hUa2b*%Syz(c_6Nrwp2O)l%>y2V3?6JQQtGvXC5sV zbsB$gH@^j~p_Quzlt1Hss-teT;gdo9QHLc*7uSmNvI5Wdz7zMV>t{}GjO#}YS||!b z`dJF&D)4FVP~n+ibHIY@hV9sJTj-UPMGc7xYh$?`K&PTp2Xd5i0}irC`6FJY_Bj`Z ze#j26U~5G7>xOZI+;`voRXZZAaUW{&kD{IuJx1BUPW>o5MBdTqI^_UF%TEq8^voq& z4x=M{c{=nt*s|wbwX*dQ7uXv+_eQw!zvc4t;b6VC zA1XHu9UGbkeRn;vVry!lcedfnhHII4+JP#fWogbUQ=ok6PmC;_z4{9=vi6E31OjrA zLDx+FXw%RU@+N zNstEL@W+%BXdrra3y{e02ldoOkJ6nP)A->?aa)tvn=4%OR9+UB**Dv#Tiea^%?7h7 z>fvOV&5(&S-O09(4qNaEYU z$JzrDVm0)C&1HhpbypC!O!sT6!2kT|b@tZJg}Tn{O*!z2ucd5Jq--BE5jFjivRS;0 zC++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nk1L5Z& zoK=GvUnm%v$|tz9-8y(b3Y*+xlcF~3ATco3is_s00!dFXrH|ro!(Q#A+^VjiZMV;M)W1p7!GYE`Qxa&jEOn1S(8B&L0BaJ`{P3WY4HfoT)|v{YyK+ z;K`-R(TZW)dDr7XTW7xXMV9j6<>61E~ zzfJV$Rf=k~pE6s!D<6Ph{JB<3m6BN&8{JdEPd!qPwx}M^@`8R$1&6y>jqFoJ9Y}}Z zA64-Glk9`{lDV`b^;s9r1|xjCh!OUH_d(!5@wpWw;Fs*vALU8&u^e<(t`1+2A6S(@dR~}SvX^2{IDT7 zg|OFZFwj)9Kyo#(g^Pe>Cch+~J-wAy%(p{Zf7SqdQS$C`k6|6USCRw4_{N4CtBAJ3 zuhTz&&Tp=JSGKash&p2xu#CAEMM@JI{5uMjMO9QSr^5t{n!U9OGlyD6yAvjsL^#-@ z$g2O5-*DFvQ2@{JNbp0+emR7EWPt8cV+o4QDzeJWWdD@a4f)syb9Pm2eB-s2;CR_C z{P8#Mg(5zFuo}7Wc<{Asd%Ie@T8>c7VXk6TY2$aN_-_}QYF|PPG_ydWy%Jg=Cbjos z+oZj^M?x{b8uE{$7f}78CAm$DyQZX8pG`4xowud;@}+;>`Wh;sb_m5Y{29KvoqP;p zt$3+Ocv5u66$>}*Q`&W~g4vBQE}&E&QG`QpOmF#}C6A+G?zD^Q8`B{FqAkjn6k(xO z-Tm8;e*IgY(r{K2Qp72=Lvr)>$TX(zbfbyD*3Hk>9S3N8lRj+{>wv+Co}ue>IIwj* z|8T2Hh#2j '' }, ID_DATE: { calc: () => {var d = (new Date).toString().split(" "); return d[2] + ' ' + d[1] + ' ' + d[3];} }, ID_DAY: { calc: () => {var d = require("locale").dow(new Date).toLowerCase(); return d[0].toUpperCase() + d.substring(1);} }, + ID_SR: { calc: () => 'Sunrise: ' + sunRise }, + ID_SS: { calc: () => 'Sunset: ' + sunSet }, ID_STEP: { calc: () => 'Steps: ' + stepsWidget().getSteps() }, ID_BATT: { calc: () => 'Battery: ' + E.getBattery() + '%' }, ID_MEM: { calc: () => {var val = process.memory(); return 'Ram: ' + Math.round(val.usage*100/val.total) + '%';} }, @@ -169,6 +196,9 @@ Bangle.setUI("clockupdown", btn=> { loadSettings(); loadFonts(); +loadLocation(); +updateSunRiseSunSet(new Date(), location.lat, location.lon); + g.clear(); var secondInterval = setInterval(draw, 1000); draw(); From 070558a0a62027fc67e9d54b45ef81e2166d6fab Mon Sep 17 00:00:00 2001 From: hughbarney Date: Fri, 26 Nov 2021 20:48:27 +0000 Subject: [PATCH 02/39] MyLocation - adds menu to set preferred city or setup from GPS --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 8b1fb586e..dc5d748a8 100644 --- a/apps.json +++ b/apps.json @@ -4466,7 +4466,7 @@ "description": "My Locations adds a menu in the Settings app to set your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", "readme": "README.md", "tags": "tool,utility", - "type": "app", + "type": "widget", "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ {"name":"mylocation.settings.js","url":"mylocation.settings.js"} From b426c479a32595b592acc1eb68a202e3ed5f0c17 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Fri, 26 Nov 2021 21:29:46 +0000 Subject: [PATCH 03/39] Pastel added dependancy on MyLocation app, display sunrise,sunset times --- apps.json | 3 ++- apps/pastel/ChangeLog | 3 ++- apps/pastel/README.md | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index dc5d748a8..1c4b074dc 100644 --- a/apps.json +++ b/apps.json @@ -4085,9 +4085,10 @@ "id": "pastel", "name": "Pastel Clock", "shortName": "Pastel", - "version": "0.06", + "version": "0.08", "description": "A Configurable clock with custom fonts and background", "icon": "pastel.png", + "dependencies": {"mylocation":"type"}, "screenshots": [{"url":"screenshot_pastel.png"}], "type": "clock", "tags": "clock", diff --git a/apps/pastel/ChangeLog b/apps/pastel/ChangeLog index 6bfd2ce59..2ede0e161 100644 --- a/apps/pastel/ChangeLog +++ b/apps/pastel/ChangeLog @@ -3,5 +3,6 @@ 0.03: Make it work with Gadgetbridge, Notifications fullscreen on a Bangle 2 0.04: Leave space at the bottom for Chrono widget, set back option at first option 0.05: Added 2 new fonts -0.06: COnverted fonts to font modules +0.06: Converted fonts to font modules 0.07: Added info line that cycles on BTN1/BTN3 (or vitual buttons on a bangle 2) +0.08: Added dependancy on MyLocation diff --git a/apps/pastel/README.md b/apps/pastel/README.md index f183005a9..151837a66 100644 --- a/apps/pastel/README.md +++ b/apps/pastel/README.md @@ -8,6 +8,7 @@ * Has a settings menu, change font, enable/disable the grid * On Bangle 1 use BTN1,BTN3 to cycle through the info display (Date, ID, Batt %, Ram % etc) * On Bangle 2 touch the top right/top left to cycle through the info display (Date, ID, Batt %, Ram % etc) +* Uses mylocation.json from MyLocation app to calculate sunrise and sunset times for your location I came up with the name Pastel due to the shade of the grid background. From 21fe6e7ea486ee553bd1bac8399d153c50171380 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Fri, 26 Nov 2021 21:52:05 +0000 Subject: [PATCH 04/39] Pastel added dependancy on MyLocation app, display sunrise,sunset times --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 1c4b074dc..f659fcbc4 100644 --- a/apps.json +++ b/apps.json @@ -4088,7 +4088,7 @@ "version": "0.08", "description": "A Configurable clock with custom fonts and background", "icon": "pastel.png", - "dependencies": {"mylocation":"type"}, + "dependencies": {"mylocation":"widget"}, "screenshots": [{"url":"screenshot_pastel.png"}], "type": "clock", "tags": "clock", From 3fbb46b046c65d8d9f1a37b600bddc0ee1e16e03 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Sat, 27 Nov 2021 11:23:03 +0000 Subject: [PATCH 05/39] Pastel, recalc sunrise,sunset every hour --- apps.json | 2 +- apps/pastel/pastel.app.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps.json b/apps.json index f659fcbc4..322a90d96 100644 --- a/apps.json +++ b/apps.json @@ -4086,7 +4086,7 @@ "name": "Pastel Clock", "shortName": "Pastel", "version": "0.08", - "description": "A Configurable clock with custom fonts and background", + "description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", "dependencies": {"mylocation":"widget"}, "screenshots": [{"url":"screenshot_pastel.png"}], diff --git a/apps/pastel/pastel.app.js b/apps/pastel/pastel.app.js index 8007ac031..aa4f6abf8 100644 --- a/apps/pastel/pastel.app.js +++ b/apps/pastel/pastel.app.js @@ -23,6 +23,7 @@ function extractTime(d){ var sunRise = "00:00"; var sunSet = "00:00"; +var drawCount = 0; function updateSunRiseSunSet(now, lat, lon, line){ // get today's sunlight times for lat/lon @@ -175,6 +176,10 @@ function draw() { g.setFontLatoSmall(); g.setFontAlign(0, -1); g.drawString((infoData[infoMode].calc()), w/2, h - 24 - 24); + + if (drawCount % 3600 == 0) + updateSunRiseSunSet(new Date(), location.lat, location.lon); + drawCount++; } // Only update when display turns on @@ -197,7 +202,6 @@ Bangle.setUI("clockupdown", btn=> { loadSettings(); loadFonts(); loadLocation(); -updateSunRiseSunSet(new Date(), location.lat, location.lon); g.clear(); var secondInterval = setInterval(draw, 1000); From 22d06c8cf6f6fb7a1e0c899480cb8c40785d81f0 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 29 Nov 2021 18:45:44 +0000 Subject: [PATCH 06/39] Pastel changed dependancy on MyLocation to type app --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 322a90d96..eec32218b 100644 --- a/apps.json +++ b/apps.json @@ -4088,7 +4088,7 @@ "version": "0.08", "description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", - "dependencies": {"mylocation":"widget"}, + "dependencies": {"mylocation":"app"}, "screenshots": [{"url":"screenshot_pastel.png"}], "type": "clock", "tags": "clock", From 6510e4b7d2965f34404f8973c5d802adfa933d6c Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 29 Nov 2021 19:02:01 +0000 Subject: [PATCH 07/39] Pastel added dependancy on widpedom --- apps.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps.json b/apps.json index fa33df5ed..770f2a286 100644 --- a/apps.json +++ b/apps.json @@ -4110,6 +4110,7 @@ "description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", "dependencies": {"mylocation":"app"}, + "dependencies": {"widpedom":"app"}, "screenshots": [{"url":"screenshot_pastel.png"}], "type": "clock", "tags": "clock", From 3fa435e57ddde56b59c75074adc0831f9ae2ba67 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 29 Nov 2021 19:58:19 +0000 Subject: [PATCH 08/39] Pastel, MyLocation updated README files --- apps/mylocation/README.md | 4 +--- apps/pastel/README.md | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/mylocation/README.md b/apps/mylocation/README.md index 3b39aa947..6ae1dd530 100644 --- a/apps/mylocation/README.md +++ b/apps/mylocation/README.md @@ -39,6 +39,4 @@ -## Creator - -[Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/) +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/) diff --git a/apps/pastel/README.md b/apps/pastel/README.md index 151837a66..66ae0e189 100644 --- a/apps/pastel/README.md +++ b/apps/pastel/README.md @@ -1,6 +1,6 @@ # Pastel Clock - *a configurable clock with custom fonts and background* + *a configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times* * Designed specifically for Bangle 1 and Bangle 2 * A choice of 7 different custom fonts @@ -9,12 +9,12 @@ * On Bangle 1 use BTN1,BTN3 to cycle through the info display (Date, ID, Batt %, Ram % etc) * On Bangle 2 touch the top right/top left to cycle through the info display (Date, ID, Batt %, Ram % etc) * Uses mylocation.json from MyLocation app to calculate sunrise and sunset times for your location - +* Uses pedometer widget to get latest step count +* Dependant apps are installed when Pastel installs I came up with the name Pastel due to the shade of the grid background. -## Creator -[Hugh Barney](https://github.com/hughbarney) +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/) ## Lato ![](screenshot_lato.png) From b50faa919a9f8c50687a16435d7db946771b674b Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 29 Nov 2021 20:12:25 +0000 Subject: [PATCH 09/39] Pebble - long live the rebellion --- apps.json | 18 ++++- apps/pebble/ChangeLog | 1 + apps/pebble/icons8-sport-shoes-64.png | Bin 0 -> 2522 bytes apps/pebble/pebble.app.js | 103 ++++++++++++++++++++++++++ apps/pebble/pebble.png | Bin 0 -> 1213 bytes apps/pebble/pebble.settings.js | 38 ++++++++++ apps/pebble/pebble_screenshot.png | Bin 0 -> 2799 bytes apps/pebble/pebble_screenshot2.png | Bin 0 -> 2736 bytes apps/pebble/pebble_screenshot3.png | Bin 0 -> 2788 bytes 9 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 apps/pebble/ChangeLog create mode 100644 apps/pebble/icons8-sport-shoes-64.png create mode 100644 apps/pebble/pebble.app.js create mode 100644 apps/pebble/pebble.png create mode 100644 apps/pebble/pebble.settings.js create mode 100644 apps/pebble/pebble_screenshot.png create mode 100644 apps/pebble/pebble_screenshot2.png create mode 100644 apps/pebble/pebble_screenshot3.png diff --git a/apps.json b/apps.json index 770f2a286..cfac33be3 100644 --- a/apps.json +++ b/apps.json @@ -4543,5 +4543,21 @@ "storage": [ {"name":"mylocation.settings.js","url":"mylocation.settings.js"} ] - } + }, + { + "id": "pebble", + "name": "Pebble Clock", + "shortName": "Pebble", + "version": "0.01", + "description": "A pebble style clock to keep the rebellion going", + "icon": "pebble.png", + "dependencies": {"widpedom":"app"}, + "screenshots": [{"url":"screenshot_pebble.png"}], + "type": "clock", + "tags": "clock", + "supports": ["BANGLEJS2"], + "storage": [ + {"name":"pebble.app.js","url":"pebble.app.js"}, + {"name":"pebble.img","url":"pebble.icon.js","evaluate":true}, + } ] diff --git a/apps/pebble/ChangeLog b/apps/pebble/ChangeLog new file mode 100644 index 000000000..9db0e26c5 --- /dev/null +++ b/apps/pebble/ChangeLog @@ -0,0 +1 @@ +0.01: first release diff --git a/apps/pebble/icons8-sport-shoes-64.png b/apps/pebble/icons8-sport-shoes-64.png new file mode 100644 index 0000000000000000000000000000000000000000..4ae00db96a02ace82a8f08eb43bbf32a0c08b255 GIT binary patch literal 2522 zcmV<02_^Q4P)^p0K_gw z1`vtanBN840CC8$+eCW@$F4@i1Bt-#o7uUZkXtz34#08V!o^I#dk!{g4V4vT7!3Ns zfG6Mzd=HdcShvqu`WbBmNKHJ8T%jQN&dJz2IClNs7B~xh0VDv&EUe#aES&*yKy+1Q zxs{`nGwz;Vq$Zui*3OP4D;`CuR8mz@CKCj~5AXsUfq&C(+|57+oCGF!X-fd^1*-cP zb2;#_m6ej^k3NN~n|rq}KYo8ZmE~n!oAkg(KnQRNn9)bwJ|PFz1I}IAynxxjK0w=t znEAk5K`^W~QUnHh09Z1s(+yKoaKc=vU;J@7Plfr}vWU?pGxQUFtb z8PHLn>;oe1d2Ah_5m9K2ZM?HOnv(onfQ!It-~?BUZ~>;Zw@(3(D-?vxyq7skAI5uR zK&OBpn20;{B{3hqOJ#8Z08Y-Xj2Rn@w~sGQPA*s}m7V7o7hWXx`@@tL7j`t2051c( z0Aqg{unPF+=oxcZ_}pf^U7TocsAuaF4^ohwaoqrFJ9}nCEN0f?Xk0wJu6drxWF-EZ z1Ko`1C3Qe@mm>wp;|8$J7$_}xDrB&O^ z9V7g??RFo&-nW;wHXZXO4`F7=Kvr&!qe*LE+_YItoIM|aps8VWZ>aFa_2ud`uV@CL{Z!dxB+XyycqHY7~&rYK%2?pGtE`RA3i`qRyy_$ zj!c*`oz%p$R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z^l5V z3^&h#m;?cNA4cSUM- literal 0 HcmV?d00001 diff --git a/apps/pebble/pebble.app.js b/apps/pebble/pebble.app.js new file mode 100644 index 000000000..5ef8099c6 --- /dev/null +++ b/apps/pebble/pebble.app.js @@ -0,0 +1,103 @@ +// inspired by +//https://apps.rebble.io/en_US/application/55cf75fc61e031bb4b000025?dev_settings=true§ion=watchfaces + +Graphics.prototype.setFontQahiri = function(scale) { + // Actual height 60 (60 - 1) + g.setFontCustom(atob("AAAAAAAAfAAAAAAAAAAAAP4AAAAAAAAAAAD/AAAAAAAAAAAB/wAAAAAAAAAAAf8AAAAAAAAAAAH/AAAAAAAAAAAA/wAAAAAAAAAAAH4AAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAB8AAAAAAAAAAAD/gAAAAAAAAAAH/4AAAAAAAAAAP/8AAAAAAAAAAP/4AAAAAAAAAAf/4AAAAAAAAAA//wAAAAAAAAAB//gAAAAAAAAAD//AAAAAAAAAAD//AAAAAAAAAAH/+AAAAAAAAAAP/8AAAAAAAAAAf/4AAAAAAAAAAf/4AAAAAAAAAA//wAAAAAAAAAB//gAAAAAAAAAD//AAAAAAAAAAH/+AAAAAAAAAAH/+AAAAAAAAAAP/8AAAAAAAAAAH/4AAAAAAAAAAB/wAAAAAAAAAAAPwAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD/AAAD/AAAAAAA/wAAA/wAAAAAAP8AAAP8AAAAAAD/AAAD/AAAAAAA/wAAA/wAAAAAAP8AAAP8AAAAAAD/AAAD/AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAH///gH8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///AAAAAAAAAAP//wAAAAAAAAAD//8AAAAAAAAAA///AAAAAAAAAAP//wAAAAAAAAAD//8AAAAAAAAAA///AAAAAAAAAAP//wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAH8A///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAP8B///8AAAAAAD/Af///AAAAAAA/wH///wAAAAAAH8A///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA/wAAAAAAAAAAAP8AAAAAAAAAAAD/AAAAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD///4D/AAAAAAA///+A/wAAAAAAP///gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA/wH+A/wAAAAAAP8B/gP8AAAAAAD/Af4D/AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAP/////8AAAAAAD//////AAAAAAA//////wAAAAAAH/////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+AAfAAAAAAAAAfwAP4AAAAAAAAP8AD/AAAAAAAAD/gB/wAAAAAAAA/4Af8AAAAAAAAP+AH/AAAAAAAAD/AA/wAAAAAAAAfgAH4AAAAAAAABwAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=="), 46, atob("DR0bDBsbGxsbGxsbDQ=="), 80+(scale<<8)+(1<<16)); +} + +const SETTINGS_FILE = "pebble.json"; +let settings; + +function loadSettings() { + settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#0f0', 'color': 'Green'}; +} + +var img = require("heatshrink").decompress(atob("oFAwkGswA/AH4A/AH4A/AH4A/AFEAD74gdsAfBELlggMhD70iILsAiUAIKQRBgxAHgUiIKQQJUAMSD4JBQsBVBIAq/DEAJBCJ45VHkAxEDwKfDIIUREBq2BmcQCAQeCkczmRBEiAgND4MxSoYGBAAQgCAAohKDARhBG4IeDEAQ8BAA5fJABgpBgFDgEiQgJEHT4IeMmMBkMFAYJJDEQaYDiYfMkECiEEoEDBAX//8ykJsBD4MAWwIALiBeCqAyDn//BoYgBgAeMYAMhgE0CRIOBD58BkEEmCRKkEGD5szkUQqdASJUxD4MAgKBKmUigFEGJZgBAATODFw0CkEBmoOJAAQdB7owBOBDdCgbdED5fd6pRIgDdCeBkxD4fdeAgNEkMFmheLdgIfE6BgGmDdCoDdKDwYfD6gzGiBeBrpLHXYUQXIMgD4NND4SAFZgMRgAKBPwroBBYIeBIAL/CADESL4VmsAcWgMRkQeDAAMAkQAWMAQeCD4MSDqqdBDwgfBAC8GDwiAXDowA/AH4A/AH4A/AH4A/AEA")); + +const h = g.getHeight(); +const w = g.getWidth(); +const ha = 2*h/5 - 8; +const h2 = 3*h/5 - 10; +const h3 = 7*h/8; + +function draw() { + var date = new Date(); + var da = date.toString().split(" "); + //var timeStr = require("locale").time(date,1); // causes screen corruption ??? + var timeStr = da[4].substr(0,5); + const t = 6; + + g.reset(); + g.setColor(settings.bg); + g.fillRect(0, 0, w, h2 - t); + + // contrast bar + g.setColor(g.theme.fg); + g.fillRect(0, h2 - t, w, h2); + + // day and steps + g.setColor('#000'); // really needs to be black regardless of theme + g.setFont('Vector', 22); + g.setFontAlign(0, -1); + g.drawString(da[0], w/4, ha); // day of week + g.drawString(getSteps(), 3*w/4, ha); + + // time + g.setColor(g.theme.bg); + g.fillRect(0, h2, w, h3); + g.setFontQahiri(); + g.setFontAlign(0, -1); + g.setColor(g.theme.fg); + g.drawString(timeStr, w/2, h2 - 8); + + // contrast bar + g.setColor(g.theme.fg); + g.fillRect(0, h3, w, h3 + t); + + // the bottom + g.setColor(settings.bg); + g.fillRect(0, h3 + t, w, h); + + g.setColor(settings.bg); + g.drawImage(img, w/2 + ((w/2) - 64)/2, 10, { scale: 1 }); + drawCalendar(((w/2) - 48)/2, 10, 48, 4, da[2]); +} + +// at x,y width:wi thicknes:th +function drawCalendar(x,y,wi,th,str) { + g.setColor(g.theme.fg); + g.fillRect(x, y, x + wi, y + wi); + g.setColor(g.theme.bg); + g.fillRect(x + th, y + th, x + wi - th, y + wi - th); + g.setColor(g.theme.fg); + + var hook_t = 6; + // first calendar hook, one third in + g.fillRect(x + (wi/3) - (th/2), y - hook_t, x + wi/3 + th - (th/2), y + hook_t); + // second calendar hook, two thirds in + g.fillRect(x + (2*wi/3) -(th/2), y - hook_t, x + 2*wi/3 + th - (th/2), y + hook_t); + + g.setFont('Vector', 22); + g.setFontAlign(0, 0); + g.drawString(str, x + wi/2 + th/2, y + wi/2 + th/2); +} + +function getSteps() { + if (WIDGETS.wpedom !== undefined) { + return WIDGETS.wpedom.getSteps(); + } + return '????'; +} + +g.clear(); +Bangle.loadWidgets(); +/* + * we are not drawing the widgets as we are taking over the whole screen + * so we will blank out the draw() functions of each widget + */ +for (var wd of WIDGETS) {wd.draw=()=>{};} +loadSettings(); +setInterval(draw, 15000); // refresh every 15s +draw(); +Bangle.setUI("clock"); diff --git a/apps/pebble/pebble.png b/apps/pebble/pebble.png new file mode 100644 index 0000000000000000000000000000000000000000..10f5adb56b224f3e4d037c4d195fbd9efc81b959 GIT binary patch literal 1213 zcmV;u1Va0XP)POM$%3@Whhhyn@nYhxDeg-e<-cZ zYFr2k?%buN)IY$D3u)c7&`lO@rMoJkr~#QIf+Nxtsa1-};Ey=&+{^zdH@zOnM{mX zvjtWIh=|(&%XQtCm^E8qH2}cN%z6O8ZE6bK^H45MbUEA#JEV9`wMn*=ov6V^% zySuwkO0~5~DF?#<%d&1sDYbW0Hk-xj>T1XM!^1;VDwVeD28LA&YzBC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null +++ b/apps/pebble/pebble.settings.js @@ -0,0 +1,38 @@ +(function(back) { + const SETTINGS_FILE = "pebble.json"; + + // initialize with default settings... + let s = {'bg': '#0f0', 'color': 'Green'} + + // ...and overwrite them with any saved values + // This way saved values are preserved if a new version adds more settings + const storage = require('Storage') + let settings = storage.readJSON(SETTINGS_FILE, 1) || s; + const saved = settings || {} + for (const key in saved) { + s[key] = saved[key] + } + + function save() { + settings = s + storage.write(SETTINGS_FILE, settings) + } + + var color_options = ['Green','Orange','Cyan','Perple','Red','Blue']; + var bg_code = ['#0f0','#ff0','#0ff','#f0f','#f00','#00f']; + + E.showMenu({ + '': { 'title': 'Pebble Clock' }, + '< Back': back, + 'Colour': { + value: 0 | color_options.indexOf(s.color), + min: 0, max: 5, + format: v => color_options[v], + onchange: v => { + s.color = color_options[v]; + s.bg = bg_code[v]; + save(); + }, + } + }); +}) diff --git a/apps/pebble/pebble_screenshot.png b/apps/pebble/pebble_screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..d618368db84657fdc60e478c4507fac2bb9c931f GIT binary patch literal 2799 zcmZuzdpy(o8~<#>v~nw#VEprLND^FwFVGduQ?Cdqky^LueAWUzp~3flF)zRVW6ZrS=}BZ9*q)2?lW%D zYbYLjH7752!NDlH&tPcUyE4wnJpf@2>NE^P#g&UGU+-?}6OGGUb#%UjuA<;0gU;P_7dMwfo3PVuU?cl@!H0}R6Co$qT8`c73+yPi?O2wtm=;r13iG3J6qhaBz>Eq>BH_vE} z`nhS-7_=IgqF`P~Na2&>L)~EY@=rDgxe8xQr4G?yP02aY`h&xJc)W!L-YwtG>-bwP z9|Cacab`rVdvD51dvi`%N&Dl9|Ms9|U5O`!puaz>RE3cm99Fvyw@rQLMKY=j~H&XCK|pjPKhf3hq!FyoIsOLohDOrZtz%w1f)Mea z>ZHxZ8O?x0G{$FcYw?{&g(LLZ8`efqlZo~O>YKg@N&dHphvSkS9(dUh$F)rH$2!#T zp38m0Y{p-ik5FVxew*E%sj+aHdRRex#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ZMleI#{7lXuWh-M z3uTCD@7qVj2IdF*&1(w|I}n(H9n9zt11SGf@qpUHr8q;y)p6$zsW z#f(P_Rx%9_EFx_Bp~T-vp2j}<7Vg8@iD0EH24{xpz0jrsCss{mET72bg};*X=7eya`f0m3*{b-S4-1v#wI_8=8%Z59eUkDxJ?tZuuv1u%Tdr`xNo@&q$E7Q2nIS=+b6 zSZ~p*Cg$R*9MIblLa~e+W3QVgq@7N&_&nTSE4ZjG>)ye>H}m%;Tag* z=>|wfz2{~x!GVcy;O?^m+yky*%yR*au7Q-HpsgIE9+>$;fK#rb$O8l*mOOu-UkN}d z=4P6s0ORUA?&JwbJ?gKHl?X89x{;-V=AYa#y4Mu~I^1#_dIS`gG9vDj191LH`_Lp} Z1IS-lm>yN9{UNZe0B!4JQ)!J${WlQI5-k7# literal 0 HcmV?d00001 From 6642b216066519d90e1bb0b46c1c8b731ff270b8 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 29 Nov 2021 20:27:25 +0000 Subject: [PATCH 10/39] added pebble icon --- apps/pebble/pebble.app.js | 35 +++++++++++++++++++++++++---------- apps/pebble/pebble.icon.js | 1 + 2 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 apps/pebble/pebble.icon.js diff --git a/apps/pebble/pebble.app.js b/apps/pebble/pebble.app.js index 5ef8099c6..6b7f7b492 100644 --- a/apps/pebble/pebble.app.js +++ b/apps/pebble/pebble.app.js @@ -1,5 +1,3 @@ -// inspired by -//https://apps.rebble.io/en_US/application/55cf75fc61e031bb4b000025?dev_settings=true§ion=watchfaces Graphics.prototype.setFontQahiri = function(scale) { // Actual height 60 (60 - 1) @@ -21,13 +19,26 @@ const ha = 2*h/5 - 8; const h2 = 3*h/5 - 10; const h3 = 7*h/8; +let batterWarning = false; + function draw() { - var date = new Date(); - var da = date.toString().split(" "); - //var timeStr = require("locale").time(date,1); // causes screen corruption ??? - var timeStr = da[4].substr(0,5); + let date = new Date(); + let da = date.toString().split(" "); + //let timeStr = require("locale").time(date,1); // causes screen corruption ??? + let timeStr = da[4].substr(0,5); const t = 6; + // turn the warning on once we have dipped below 30% + if (E.getBattery() < 30) + batterWarning = true; + + // turn the warning off once we have dipped above 40% + if (E.getBattery() > 40) + batterWarning = false; + + // for testing only + batterWarning = true; + g.reset(); g.setColor(settings.bg); g.fillRect(0, 0, w, h2 - t); @@ -37,14 +48,18 @@ function draw() { g.fillRect(0, h2 - t, w, h2); // day and steps - g.setColor('#000'); // really needs to be black regardless of theme + if (settings.color == 'Blue' || settings.color == 'Red') + g.setColor('#fff'); // white on blue or red best contrast + else + g.setColor('#000'); // otherwise black regardless of theme + g.setFont('Vector', 22); g.setFontAlign(0, -1); g.drawString(da[0], w/4, ha); // day of week g.drawString(getSteps(), 3*w/4, ha); // time - g.setColor(g.theme.bg); + g.setColor(!batteryWarning ? g.theme.bg ? '#f00'); g.fillRect(0, h2, w, h3); g.setFontQahiri(); g.setFontAlign(0, -1); @@ -72,7 +87,7 @@ function drawCalendar(x,y,wi,th,str) { g.fillRect(x + th, y + th, x + wi - th, y + wi - th); g.setColor(g.theme.fg); - var hook_t = 6; + let hook_t = 6; // first calendar hook, one third in g.fillRect(x + (wi/3) - (th/2), y - hook_t, x + wi/3 + th - (th/2), y + hook_t); // second calendar hook, two thirds in @@ -96,7 +111,7 @@ Bangle.loadWidgets(); * we are not drawing the widgets as we are taking over the whole screen * so we will blank out the draw() functions of each widget */ -for (var wd of WIDGETS) {wd.draw=()=>{};} +for (let wd of WIDGETS) {wd.draw=()=>{};} loadSettings(); setInterval(draw, 15000); // refresh every 15s draw(); diff --git a/apps/pebble/pebble.icon.js b/apps/pebble/pebble.icon.js new file mode 100644 index 000000000..ecd7feb7f --- /dev/null +++ b/apps/pebble/pebble.icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("oFAwgNKiIAIFqofegIf/DAUzAAMyAwUQD60T/4ACD7Q/cPxIf/YCofcDhYiSXYYfuUZgf/D/4f/D6USkUgD/4fuogAID6vtDw/UD6vu6geF73kb6vuEAtN9wfYMIneD7JADDwIfaIAJdBD7YgBHwQfbAAgfkf6Qf/D/4feogAID6oAND/4f/iAdJD/4f/D/4fUDxYABD74iODiAftTZgfnYYczAAMyD7UT/4ACH/S+bD8DAKD9Y=")) From ac1425ca7cfaf46041790a3223e1f3383f7a2ae2 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 13:07:56 +0000 Subject: [PATCH 11/39] set mylocation to an app --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index cfac33be3..e77ef0840 100644 --- a/apps.json +++ b/apps.json @@ -4538,7 +4538,7 @@ "description": "My Locations adds a menu in the Settings app to set your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", "readme": "README.md", "tags": "tool,utility", - "type": "widget", + "type": "app", "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ {"name":"mylocation.settings.js","url":"mylocation.settings.js"} From 5b7bbd83db31769a8b255821729d1cad5d5a81c8 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 13:30:13 +0000 Subject: [PATCH 12/39] Pebble: added README, battery warning if below 30% --- apps.json | 1 + apps/pebble/README.md | 17 +++++++++++++++++ apps/pebble/pebble.app.js | 14 ++++++-------- 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 apps/pebble/README.md diff --git a/apps.json b/apps.json index ab74c9ee1..13838a962 100644 --- a/apps.json +++ b/apps.json @@ -4581,6 +4581,7 @@ "shortName": "Pebble", "version": "0.01", "description": "A pebble style clock to keep the rebellion going", + "readme": "README.md", "icon": "pebble.png", "dependencies": {"widpedom":"app"}, "screenshots": [{"url":"screenshot_pebble.png"}], diff --git a/apps/pebble/README.md b/apps/pebble/README.md new file mode 100644 index 000000000..f0de5ce73 --- /dev/null +++ b/apps/pebble/README.md @@ -0,0 +1,17 @@ +# Pebble + + *a Pebble style clock with configurable background color, to keep the revolution going* + +* Designed specifically for Bangle 2 +* A choice of 6 different background colous through its setting menu +* Supports the Light and Dark themes +* Uses pedometer widget to get latest step count +* Dependant apps are installed when Pebble installs +* Uses the whole screen, widgets are made invisible but still run in the background +* When battery is less than 30% main screen goes Red + +![](pebble_screenshot.png) +![](pebble_screenshot2.png) +![](pebble_screenshot3.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/) diff --git a/apps/pebble/pebble.app.js b/apps/pebble/pebble.app.js index 6b7f7b492..62159055d 100644 --- a/apps/pebble/pebble.app.js +++ b/apps/pebble/pebble.app.js @@ -19,7 +19,7 @@ const ha = 2*h/5 - 8; const h2 = 3*h/5 - 10; const h3 = 7*h/8; -let batterWarning = false; +let batteryWarning = false; function draw() { let date = new Date(); @@ -30,14 +30,11 @@ function draw() { // turn the warning on once we have dipped below 30% if (E.getBattery() < 30) - batterWarning = true; + batteryWarning = true; // turn the warning off once we have dipped above 40% if (E.getBattery() > 40) - batterWarning = false; - - // for testing only - batterWarning = true; + batteryWarning = false; g.reset(); g.setColor(settings.bg); @@ -59,11 +56,12 @@ function draw() { g.drawString(getSteps(), 3*w/4, ha); // time - g.setColor(!batteryWarning ? g.theme.bg ? '#f00'); + // white on red for battery warning + g.setColor(!batteryWarning ? g.theme.bg : '#f00'); g.fillRect(0, h2, w, h3); g.setFontQahiri(); g.setFontAlign(0, -1); - g.setColor(g.theme.fg); + g.setColor(!batteryWarning ? g.theme.fg : '#fff'); g.drawString(timeStr, w/2, h2 - 8); // contrast bar From 78c3791c1e6af33dc127418a172a22b0b9c96df9 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 13:48:20 +0000 Subject: [PATCH 13/39] Pebble screenshot updated --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 13838a962..4c1b0bed6 100644 --- a/apps.json +++ b/apps.json @@ -4584,7 +4584,7 @@ "readme": "README.md", "icon": "pebble.png", "dependencies": {"widpedom":"app"}, - "screenshots": [{"url":"screenshot_pebble.png"}], + "screenshots": [{"url":"pebble_screenshot.png"}], "type": "clock", "tags": "clock", "supports": ["BANGLEJS2"], From c1a48e7b48ddb4087b63171bde681ea1e79ca76f Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:09:52 +0800 Subject: [PATCH 14/39] Try different JSON format --- apps/authentiwatch/interface.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/authentiwatch/interface.html b/apps/authentiwatch/interface.html index 12c0c1d8d..0b7774557 100644 --- a/apps/authentiwatch/interface.html +++ b/apps/authentiwatch/interface.html @@ -333,7 +333,8 @@ function loadTokens() { */ function saveTokens() { Util.showModal('Saving...'); - Puck.write(`\x10require('Storage').write(${JSON.stringify('authentiwatch.json')},${JSON.stringify(tokens)})\n`,()=>{ + let save={data:tokens,count:tokens.length}; + Puck.write(`\x10require('Storage').write(${JSON.stringify('authentiwatch.json')},${JSON.stringify(save)})\n`,()=>{ Util.hideModal(); }); } From 0e3b17be6757527c1f372fa8b9d5bbc8f3985035 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 16:12:47 +0000 Subject: [PATCH 15/39] Added icon for mylocation --- apps.json | 5 ++--- apps/mylocation/mylocation.icon.js | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 apps/mylocation/mylocation.icon.js diff --git a/apps.json b/apps.json index 4c1b0bed6..8c6d5c9c5 100644 --- a/apps.json +++ b/apps.json @@ -4110,7 +4110,6 @@ "description": "A Configurable clock with custom fonts and background. Has a cyclic information line that includes, day, date, battery, sunrise and sunset times", "icon": "pastel.png", "dependencies": {"mylocation":"app"}, - "dependencies": {"widpedom":"app"}, "screenshots": [{"url":"screenshot_pastel.png"}], "type": "clock", "tags": "clock", @@ -4572,7 +4571,8 @@ "type": "app", "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ - {"name":"mylocation.settings.js","url":"mylocation.settings.js"} + {"name":"mylocation.settings.js","url":"mylocation.settings.js"}, + {"name":"mylocation.img","url":"mylocation.icon.js","evaluate": true } ] }, { @@ -4583,7 +4583,6 @@ "description": "A pebble style clock to keep the rebellion going", "readme": "README.md", "icon": "pebble.png", - "dependencies": {"widpedom":"app"}, "screenshots": [{"url":"pebble_screenshot.png"}], "type": "clock", "tags": "clock", diff --git a/apps/mylocation/mylocation.icon.js b/apps/mylocation/mylocation.icon.js new file mode 100644 index 000000000..bfb38d5ac --- /dev/null +++ b/apps/mylocation/mylocation.icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEw4UA///t/7j/P3/vB4cBqtVoAbHBQIABBQ0FBYdQBYsVBYdUERIkGHIQADHoguEGAwuEGAwKFBZg8DHQw8EBYNf/1Vq3/8oLDIwNf/Wpv//0oLG9Wq3/qBYJUCBYuqBaBqBBYW+BepHEBbybCBYP+BYSnErYLDyoLFAANq/r8Ga5T7MBZZUBAAhSCfhA6DBZhIGBQg8FHQg8GHQgwGFwowFBQwwDFwwLMlS7Bqta1AKEn2q1K1C1WgBYf/1WqBYIDB1QKCgYLC0taBYoXB/QICBY0//7vBAAQ8EEgIABCwwME9QVEA")) From f127bef66b9c4c88e8094594a90ac4aad53b26e9 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:14:47 +0800 Subject: [PATCH 16/39] Load new JSON format --- apps/authentiwatch/interface.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/authentiwatch/interface.html b/apps/authentiwatch/interface.html index 0b7774557..17b7648ea 100644 --- a/apps/authentiwatch/interface.html +++ b/apps/authentiwatch/interface.html @@ -322,7 +322,8 @@ function loadTokens() { Puck.eval(`require('Storage').read(${JSON.stringify('authentiwatch.json')})`,data=>{ Util.hideModal(); try { - tokens = JSON.parse(data); + let saved = JSON.parse(data); + tokens = saved.data; updateTokens(); } catch { tokens = []; From 51c91bf9eede044c0093bf265855d149547697d2 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:17:26 +0800 Subject: [PATCH 17/39] Rename variable --- apps/authentiwatch/interface.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/authentiwatch/interface.html b/apps/authentiwatch/interface.html index 17b7648ea..6b39c148b 100644 --- a/apps/authentiwatch/interface.html +++ b/apps/authentiwatch/interface.html @@ -322,8 +322,8 @@ function loadTokens() { Puck.eval(`require('Storage').read(${JSON.stringify('authentiwatch.json')})`,data=>{ Util.hideModal(); try { - let saved = JSON.parse(data); - tokens = saved.data; + let load = JSON.parse(data); + tokens = load.data; updateTokens(); } catch { tokens = []; From 989dc5ccd4ede2fcc8f9bc82d9d5c4ad84981360 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:18:44 +0800 Subject: [PATCH 18/39] Use new JSON format. --- apps/authentiwatch/app.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/authentiwatch/app.js b/apps/authentiwatch/app.js index 43eff4709..c1316fe45 100644 --- a/apps/authentiwatch/app.js +++ b/apps/authentiwatch/app.js @@ -8,6 +8,7 @@ const algos = { }; var tokens = require("Storage").readJSON("authentiwatch.json", true) || []; +tokens = tokens.data; // QR Code Text // From e1c67cf345cf0b1093caa7c41c8e8981de8f24cb Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:22:23 +0800 Subject: [PATCH 19/39] Save in new JSON format too --- apps/authentiwatch/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/authentiwatch/app.js b/apps/authentiwatch/app.js index c1316fe45..da8b6d220 100644 --- a/apps/authentiwatch/app.js +++ b/apps/authentiwatch/app.js @@ -258,7 +258,8 @@ function onSwipe(e) { } if (e == -1 && state.curtoken != -1 && tokens[state.curtoken].period <= 0) { tokens[state.curtoken].period--; - require("Storage").writeJSON("authentiwatch.json", tokens); + let save={data:tokens,count:tokens.length}; + require("Storage").writeJSON("authentiwatch.json", save); state.nextTime = 0; state.hide = 2; draw(); From f094cc6e354ada59d50719bd8af60bfe1f258cb3 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:25:00 +0800 Subject: [PATCH 20/39] Update ChangeLog --- apps/authentiwatch/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/authentiwatch/ChangeLog b/apps/authentiwatch/ChangeLog index 7b83706bf..67cb00c67 100644 --- a/apps/authentiwatch/ChangeLog +++ b/apps/authentiwatch/ChangeLog @@ -1 +1,2 @@ +0.02: Fix JSON save format 0.01: First release From 31eaeadee2929e93fdee2ee01974cf2779e5ed13 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Wed, 1 Dec 2021 00:26:39 +0800 Subject: [PATCH 21/39] Update Authentiwatch version --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 2e338a432..36102264e 100644 --- a/apps.json +++ b/apps.json @@ -4433,7 +4433,7 @@ "shortName": "AuthWatch", "icon": "app.png", "screenshots": [{"url":"screenshot.png"}], - "version": "0.01", + "version": "0.02", "description": "Google Authenticator compatible tool.", "tags": "tool", "interface": "interface.html", From 4669099645a46062a63a9e77771b7ab1cf531ef2 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 18:11:08 +0000 Subject: [PATCH 22/39] MyLocation added mylocation.app.js --- apps.json | 1 + apps/mylocation/mylocation.app.js | 74 +++++++++++++++++++++++++ apps/mylocation/mylocation.settings.js | 75 ++------------------------ 3 files changed, 78 insertions(+), 72 deletions(-) create mode 100644 apps/mylocation/mylocation.app.js diff --git a/apps.json b/apps.json index 8c6d5c9c5..0f2d7b738 100644 --- a/apps.json +++ b/apps.json @@ -4571,6 +4571,7 @@ "type": "app", "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ + {"name":"mylocation.apps.js","url":"mylocation.app.js"}, {"name":"mylocation.settings.js","url":"mylocation.settings.js"}, {"name":"mylocation.img","url":"mylocation.icon.js","evaluate": true } ] diff --git a/apps/mylocation/mylocation.app.js b/apps/mylocation/mylocation.app.js new file mode 100644 index 000000000..49e74a025 --- /dev/null +++ b/apps/mylocation/mylocation.app.js @@ -0,0 +1,74 @@ +Bangle.loadWidgets(); +Bangle.drawWidgets(); + +const SETTINGS_FILE = "mylocation.json"; + +// initialize with default settings... +let s = { + 'lat': 51.5072, + 'lon': 0.1276, + 'location': "London" +} + +// ...and overwrite them with any saved values +// This way saved values are preserved if a new version adds more settings +const storage = require('Storage') +let settings = storage.readJSON(SETTINGS_FILE, 1) || {} +const saved = settings || {} +for (const key in saved) { + s[key] = saved[key] +} + +function save() { + settings = s + storage.write(SETTINGS_FILE, settings) +} + +const locations = ["London", "Newcastle", "Edinburgh", "Paris", "New York", "Tokyo","???"]; +const lats = [51.5072 ,54.9783 ,55.9533 ,48.8566 ,40.7128 ,35.6762, 0.0]; +const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; + +function setFromGPS() { + console.log("set from GPS"); + Bangle.setGPSPower(1); + E.showMessage("Waiting for GPS fix. Place watch in the open. Could take 10 minutes. Long press to abort", "GPS Running"); + Bangle.setUI("updown", undefined); +} + +Bangle.on('GPS', (gps) => { + //console.log("."); + if (gps.fix === 0) return; + //console.log("fix from GPS"); + s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } + Bangle.buzz(1500); // buzz on first position + Bangle.setGPSPower(0); + save(); + + Bangle.setUI("updown", ()=>{ load() }); + E.showPrompt("Location has been saved from the GPS fix",{ + title:"Location Saved", + buttons : {"OK":1} + }).then(function(v) { + load(); // load default clock + }); +}); + + +E.showMenu({ + '': { 'title': 'My Location' }, + '< Back': back, + 'City': { + value: 0 | locations.indexOf(s.location), + min: 0, max: 6, + format: v => locations[v], + onchange: v => { + if (v != 6) { + s.location = locations[v]; + s.lat = lats[v]; + s.lon = lons[v]; + save(); + } + }, + }, + 'Set From GPS': ()=>setFromGPS() +}); diff --git a/apps/mylocation/mylocation.settings.js b/apps/mylocation/mylocation.settings.js index 6936e9e69..4767c4732 100644 --- a/apps/mylocation/mylocation.settings.js +++ b/apps/mylocation/mylocation.settings.js @@ -1,73 +1,4 @@ (function(back) { - const SETTINGS_FILE = "mylocation.json"; - - // initialize with default settings... - let s = { - 'lat': 51.5072, - 'lon': 0.1276, - 'location': "London" - } - - // ...and overwrite them with any saved values - // This way saved values are preserved if a new version adds more settings - const storage = require('Storage') - let settings = storage.readJSON(SETTINGS_FILE, 1) || {} - const saved = settings || {} - for (const key in saved) { - s[key] = saved[key] - } - - function save() { - settings = s - storage.write(SETTINGS_FILE, settings) - } - - const locations = ["London", "Newcastle", "Edinburgh", "Paris", "New York", "Tokyo","???"]; - const lats = [51.5072 ,54.9783 ,55.9533 ,48.8566 ,40.7128 ,35.6762, 0.0]; - const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; - - E.showMenu({ - '': { 'title': 'My Location' }, - '< Back': back, - 'City': { - value: 0 | locations.indexOf(s.location), - min: 0, max: 6, - format: v => locations[v], - onchange: v => { - if (v != 6) { - s.location = locations[v]; - s.lat = lats[v]; - s.lon = lons[v]; - save(); - } - }, - }, - 'Set From GPS': ()=>setFromGPS() - }) - - function setFromGPS() { - console.log("set from GPS"); - Bangle.setGPSPower(1); - E.showMessage("Waiting for GPS fix. Place watch in the open. Could take 10 minutes. Long press to abort", "GPS Running"); - Bangle.setUI("updown", undefined); - } - - Bangle.on('GPS', (gps) => { - //console.log("."); - if (gps.fix === 0) return; - //console.log("fix from GPS"); - s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } - Bangle.buzz(1500); // buzz on first position - Bangle.setGPSPower(0); - save(); - - Bangle.setUI("updown", ()=>{ load() }); - E.showPrompt("Location has been saved from the GPS fix",{ - title:"Location Saved", - buttons : {"OK":1} - }).then(function(v) { - load(); // load default clock - }); - }); - -}) + // just go right to our app + load("mylocation.app.js"); +})(); From a44d542053941c7bb588e3d444aeb02ad6aba676 Mon Sep 17 00:00:00 2001 From: Richard de Boer Date: Tue, 30 Nov 2021 22:30:28 +0100 Subject: [PATCH 23/39] widbatpc: Fix drawing the bar when charging --- apps.json | 2 +- apps/widbatpc/ChangeLog | 1 + apps/widbatpc/README.md | 4 ++-- apps/widbatpc/widget.js | 16 ++++++++-------- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/apps.json b/apps.json index 2e338a432..351d03bd8 100644 --- a/apps.json +++ b/apps.json @@ -872,7 +872,7 @@ "id": "widbatpc", "name": "Battery Level Widget (with percentage)", "shortName": "Battery Widget", - "version": "0.13", + "version": "0.14", "description": "Show the current battery level and charging status in the top right of the clock, with charge percentage", "icon": "widget.png", "type": "widget", diff --git a/apps/widbatpc/ChangeLog b/apps/widbatpc/ChangeLog index 09e4fabf4..99822b5a9 100644 --- a/apps/widbatpc/ChangeLog +++ b/apps/widbatpc/ChangeLog @@ -10,3 +10,4 @@ 0.11: Don't overwrite existing settings on app update 0.12: Fixed for Bangle 2 0.13: Fillbar setting added, see README +0.14: Fix drawing the bar when charging diff --git a/apps/widbatpc/README.md b/apps/widbatpc/README.md index c75154f72..48c6070f4 100644 --- a/apps/widbatpc/README.md +++ b/apps/widbatpc/README.md @@ -5,12 +5,12 @@ Show the current battery level and charging status in the top right of the clock Works with Bangle 1 and Bangle 2 When the fillbar setting is on the level colour will fill the entire -bar. This makes for an easier to read dsiplay when the charge is +bar. This makes for an easier to read display when the charge is below 50%. ![](widbatpc.full.jpg) -When the fillbar setting is off the level colour will follow the battry percentage +When the fillbar setting is off the level colour will follow the battery percentage ![](widbatpc.part.jpg) diff --git a/apps/widbatpc/widget.js b/apps/widbatpc/widget.js index caecf8ae4..3e5ff47b4 100644 --- a/apps/widbatpc/widget.js +++ b/apps/widbatpc/widget.js @@ -79,20 +79,20 @@ // else... var s = 39; var x = this.x, y = this.y; - const l = E.getBattery(); - let xl = x+4+l*(s-12)/100; + const l = E.getBattery(), + c = levelColor(l); - // show bar full in the level color, as you cant see the color if the bar is too small - if (setting('fillbar')) - xl = x+4+100*(s-12)/100; - - c = levelColor(l); - if (Bangle.isCharging() && setting('charger')) { g.setColor(chargerColor()).drawImage(atob( "DhgBHOBzgc4HOP////////////////////3/4HgB4AeAHgB4AeAHgB4AeAHg"),x,y); x+=16; } + + let xl = x+4+l*(s-12)/100; + // show bar full in the level color, as you can't see the color if the bar is too small + if (setting('fillbar')) + xl = x+4+100*(s-12)/100; + g.setColor(g.theme.fg); g.fillRect(x,y+2,x+s-4,y+21); g.clearRect(x+2,y+4,x+s-6,y+19); From e3745f94fc0fd7bf367727a1fa2f43c26bde89b5 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 22:43:45 +0000 Subject: [PATCH 24/39] Mylocation: make into an app --- apps.json | 6 +- apps/mylocation/mylocation.app.js | 94 +++++++++++++++++-------------- 2 files changed, 55 insertions(+), 45 deletions(-) diff --git a/apps.json b/apps.json index 0f2d7b738..5442c4d88 100644 --- a/apps.json +++ b/apps.json @@ -4568,13 +4568,15 @@ "description": "My Locations adds a menu in the Settings app to set your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", "readme": "README.md", "tags": "tool,utility", - "type": "app", "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ - {"name":"mylocation.apps.js","url":"mylocation.app.js"}, + {"name":"mylocation.app.js","url":"mylocation.app.js"}, {"name":"mylocation.settings.js","url":"mylocation.settings.js"}, {"name":"mylocation.img","url":"mylocation.icon.js","evaluate": true } ] + "data": [ + {"name":"mylocation.json"} + ] }, { "id": "pebble", diff --git a/apps/mylocation/mylocation.app.js b/apps/mylocation/mylocation.app.js index 49e74a025..43d6addb1 100644 --- a/apps/mylocation/mylocation.app.js +++ b/apps/mylocation/mylocation.app.js @@ -1,7 +1,9 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); +console.log("myloc start"); const SETTINGS_FILE = "mylocation.json"; +let settings; // initialize with default settings... let s = { @@ -10,18 +12,14 @@ let s = { 'location': "London" } -// ...and overwrite them with any saved values -// This way saved values are preserved if a new version adds more settings -const storage = require('Storage') -let settings = storage.readJSON(SETTINGS_FILE, 1) || {} -const saved = settings || {} -for (const key in saved) { - s[key] = saved[key] +function loadSettings() { + console.log("loadSettings()"); + settings = require('Storage').readJSON(SETTINGS_FILE, 1) || s; } function save() { settings = s - storage.write(SETTINGS_FILE, settings) + require('Storage').write(SETTINGS_FILE, settings) } const locations = ["London", "Newcastle", "Edinburgh", "Paris", "New York", "Tokyo","???"]; @@ -30,45 +28,55 @@ const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; function setFromGPS() { console.log("set from GPS"); + Bangle.on('GPS', (gps) => { + //console.log("."); + if (gps.fix === 0) return; + //console.log("fix from GPS"); + s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } + Bangle.buzz(1500); // buzz on first position + Bangle.setGPSPower(0); + save(); + + Bangle.setUI("updown", ()=>{ load() }); + E.showPrompt("Location has been saved from the GPS fix",{ + title:"Location Saved", + buttons : {"OK":1} + }).then(function(v) { + load(); // load default clock + }); + }); + Bangle.setGPSPower(1); E.showMessage("Waiting for GPS fix. Place watch in the open. Could take 10 minutes. Long press to abort", "GPS Running"); Bangle.setUI("updown", undefined); } -Bangle.on('GPS', (gps) => { - //console.log("."); - if (gps.fix === 0) return; - //console.log("fix from GPS"); - s = {'lat': gps.lat, 'lon': gps.lon, 'location': '???' } - Bangle.buzz(1500); // buzz on first position - Bangle.setGPSPower(0); - save(); - - Bangle.setUI("updown", ()=>{ load() }); - E.showPrompt("Location has been saved from the GPS fix",{ - title:"Location Saved", - buttons : {"OK":1} - }).then(function(v) { - load(); // load default clock - }); -}); - - -E.showMenu({ - '': { 'title': 'My Location' }, - '< Back': back, - 'City': { - value: 0 | locations.indexOf(s.location), - min: 0, max: 6, - format: v => locations[v], - onchange: v => { - if (v != 6) { - s.location = locations[v]; - s.lat = lats[v]; - s.lon = lons[v]; - save(); +function showMainMenu() { + console.log("showMainMenu"); + const mainmenu = { + '': { 'title': 'My Location' }, + '{ load(); }, + 'City': { + value: 0 | locations.indexOf(s.location), + min: 0, max: 6, + format: v => locations[v], + onchange: v => { + if (v != 6) { + s.location = locations[v]; + s.lat = lats[v]; + s.lon = lons[v]; + save(); + } } }, - }, - 'Set From GPS': ()=>setFromGPS() -}); + 'Set From GPS': ()=>{ setFromGPS(); } + } + + console.log("showMainMenu 2"); + + return E.showMenu(mainmenu); +} + +loadSettings(); +showMainMenu(); +console.log("myloc end"); From 4cbd7e8ea63c5aef83f72ceedcad7a2cc811917d Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 22:46:37 +0000 Subject: [PATCH 25/39] Mylocation: make into an app --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index 5442c4d88..fc40f83bc 100644 --- a/apps.json +++ b/apps.json @@ -4573,7 +4573,7 @@ {"name":"mylocation.app.js","url":"mylocation.app.js"}, {"name":"mylocation.settings.js","url":"mylocation.settings.js"}, {"name":"mylocation.img","url":"mylocation.icon.js","evaluate": true } - ] + ], "data": [ {"name":"mylocation.json"} ] From 8e56dce22c49a1a80b4dc9142092ea5238ab34ad Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 23:10:36 +0000 Subject: [PATCH 26/39] Mylocation: make into an app --- apps/mylocation/mylocation.app.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/apps/mylocation/mylocation.app.js b/apps/mylocation/mylocation.app.js index 43d6addb1..fb2f73fa7 100644 --- a/apps/mylocation/mylocation.app.js +++ b/apps/mylocation/mylocation.app.js @@ -1,6 +1,5 @@ Bangle.loadWidgets(); Bangle.drawWidgets(); -console.log("myloc start"); const SETTINGS_FILE = "mylocation.json"; let settings; @@ -13,7 +12,6 @@ let s = { } function loadSettings() { - console.log("loadSettings()"); settings = require('Storage').readJSON(SETTINGS_FILE, 1) || s; } @@ -27,7 +25,6 @@ const lats = [51.5072 ,54.9783 ,55.9533 ,48.8566 ,40.7128 ,35.6762, 0.0]; const lons = [-0.1276 ,-1.6178 ,-3.1883 ,2.3522 , -74.0060 ,139.6503, 0.0]; function setFromGPS() { - console.log("set from GPS"); Bangle.on('GPS', (gps) => { //console.log("."); if (gps.fix === 0) return; @@ -71,12 +68,8 @@ function showMainMenu() { }, 'Set From GPS': ()=>{ setFromGPS(); } } - - console.log("showMainMenu 2"); - return E.showMenu(mainmenu); } loadSettings(); showMainMenu(); -console.log("myloc end"); From 8ad8ed15dc8e9fe4091d2f3a5b1faf7b828bb0c5 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 23:15:45 +0000 Subject: [PATCH 27/39] Mylocation: make into an app --- apps.json | 1 - 1 file changed, 1 deletion(-) diff --git a/apps.json b/apps.json index fc40f83bc..1fab6aa98 100644 --- a/apps.json +++ b/apps.json @@ -4571,7 +4571,6 @@ "supports": ["BANGLEJS", "BANGLEJS2"], "storage": [ {"name":"mylocation.app.js","url":"mylocation.app.js"}, - {"name":"mylocation.settings.js","url":"mylocation.settings.js"}, {"name":"mylocation.img","url":"mylocation.icon.js","evaluate": true } ], "data": [ From 848ccd2be996e5127d09e36960775e5cb45a4143 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 23:16:56 +0000 Subject: [PATCH 28/39] Mylocation: make into an app --- apps/mylocation/mylocation.settings.js | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 apps/mylocation/mylocation.settings.js diff --git a/apps/mylocation/mylocation.settings.js b/apps/mylocation/mylocation.settings.js deleted file mode 100644 index 4767c4732..000000000 --- a/apps/mylocation/mylocation.settings.js +++ /dev/null @@ -1,4 +0,0 @@ -(function(back) { - // just go right to our app - load("mylocation.app.js"); -})(); From 7785c7ea56867250df5985d0a27a7fd35478e501 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Tue, 30 Nov 2021 23:38:29 +0000 Subject: [PATCH 29/39] Mylocation: make into an app --- apps.json | 3 ++- apps/mylocation/README.md | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps.json b/apps.json index 1fab6aa98..371a4f2f3 100644 --- a/apps.json +++ b/apps.json @@ -4563,9 +4563,10 @@ "name": "My Location", "shortName":"My Location", "icon": "mylocation.png", + "type": "app", "screenshots": [{"url":"screenshot_1.png"}], "version":"0.01", - "description": "My Locations adds a menu in the Settings app to set your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", + "description": "Sets and stores the lat and long of your preferred City or it can be set from the GPS. mylocation.json can be used by other apps that need your main location lat and lon. See README", "readme": "README.md", "tags": "tool,utility", "supports": ["BANGLEJS", "BANGLEJS2"], diff --git a/apps/mylocation/README.md b/apps/mylocation/README.md index 6ae1dd530..aa9a04b81 100644 --- a/apps/mylocation/README.md +++ b/apps/mylocation/README.md @@ -1,8 +1,7 @@ # My Location - *a adds a My Location settings menu, stores GPS lat and lon of your preferred city* + *Sets and stores GPS lat and lon of your preferred city* -* My Location is a service app that adds a 'My Location' menu to the settings menu * Select one of the preset Cities or setup through the GPS * Other Apps can read this information to do calculations based on location * When the City shows ??? it means the location has been set through the GPS From 312bed6491d7a9341c7f9de4d1f309e2f85b3fe5 Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:00:58 +0900 Subject: [PATCH 30/39] Create app.js --- apps/a_speech_timer/app.js | 173 +++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 apps/a_speech_timer/app.js diff --git a/apps/a_speech_timer/app.js b/apps/a_speech_timer/app.js new file mode 100644 index 000000000..dae2545b2 --- /dev/null +++ b/apps/a_speech_timer/app.js @@ -0,0 +1,173 @@ +Graphics.prototype.setFontMichroma36 = function() { +g.setFontCustom(atob("AAAAAAAAAAAAAAAAeAAAAAeAAAAAeAAAAAeAAAAAAAAAAA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, atob("CBIkESMjJCMjIyMjCA=="), 36+(1<<8)+(1<<16)); +}; + +Graphics.prototype.setFontMichroma16 = function(scale) { +g.setFontCustom(atob("AAAAGAAYAAAAGAB4A/APwD4AeADgAAAAAAA/8H/4YBjAGMAcwBzAHMAcwBzAHMAYYBh/+D/wAAAAABgAOABwAGAA//h/+AAAAAA4+Hn4YZjhmMOYw5jDmMMYwxjDGOMYYxh/GD4YAAAAADBwcHhgGOAYwBzHHMccxxzHHMcc5xhnGH/4PfAAAAAAAOAB4APgB2AGYAxgHGA4YDBgYGD/+P/4AOAAYAAAAAD+cP547BjsGOwc7BzsHOwc7BzsHOwY7zjv+APgAAAAAD/wf/hmGOYYxhzGHMYcxhzGHOYYZhh3uDP4AeAAAEAA4ADgAOAI4DjgeODw4eDjgOcA7gD8APgA8AAAAAAAAAA58H/4bxjmGMYcxhzGHMYcxhzGHOYYbxh/+DnwAAAAADxgfnBnOOMYwxjDHMMcwxzDHMMY4xhjOH/4P/AAAAAABnAGcAAA"), 46, atob("BAgQCBAQEBAQEBAQBA=="), 16+(scale<<8)+(1<<16)); +}; + +function timeToString(duration) { + var hrs = ~~(duration / 3600); + var mins = ~~((duration % 3600) / 60); + var secs = ~~duration % 60; + var ret = ""; + if (hrs > 0) { + ret += "" + hrs + ":" + (mins < 10 ? "0" : ""); + } + ret += "" + mins + ":" + (secs < 10 ? "0" : ""); + ret += "" + secs; + return ret; +} + +var newtimer_left_from = 60; +var newtimer_left_to = 2*60; + +var newtimer_right_from = 5*60; +var newtimer_right_to = 7*60; + +var current_from = 5*60; +var current_mid = 6*60; +var current_to = 7*60; +var current_value = 0; + +var timerinterval; +var istimeron = false; + +var islocked = false; + +function countDown() { + current_value++; + draw(); + + if (current_value == current_from) { + Bangle.buzz(500); + } else if (current_value == current_mid) { + Bangle.buzz(400).then(()=>{ + return new Promise(resolve=>setTimeout(resolve, 800)); + }).then(()=>{ + return Bangle.buzz(500); + }); + } else if (current_value == current_to) { + Bangle.buzz(300).then(()=>{ + return new Promise(resolve=>setTimeout(resolve, 600)); + }).then(()=>{ + Bangle.buzz(300).then(()=>{ + return new Promise(resolve=>setTimeout(resolve, 600)); + }).then(()=>{ + return Bangle.buzz(500); + }); + }); + } + +} + +Bangle.on('touch',(touchside, touchdata)=>{ + if (!islocked && istimeron && touchdata.y > (100+10)) { + Bangle.buzz(40); + istimeron = false; + clearInterval(timerinterval); + } else if (touchdata.y > 24 && touchdata.y < (100-10)) { + Bangle.buzz(40); + islocked = !islocked; + } else if (!islocked && touchdata.y > (100+10) && touchdata.x > 88 + 10) { + Bangle.buzz(40); + current_from = newtimer_right_from; + current_to = newtimer_right_to; + current_mid = (current_from + current_to) / 2; + current_value = 0; + if (timerinterval) clearInterval(timerinterval); + timerinterval = setInterval(countDown, 1000); + istimeron = true; + } else if (!islocked && touchdata.y > (100+10) && touchdata.x < 88 - 10) { + Bangle.buzz(40); + current_from = newtimer_left_from; + current_to = newtimer_left_to; + current_mid = (current_from + current_to) / 2; + current_value = 0; + if (timerinterval) clearInterval(timerinterval); + timerinterval = setInterval(countDown, 1000); + istimeron = true; + } + showInstructions = false; + draw(); +}); + +Bangle.on('swipe',(swiperight, swipedown)=>{ + console.log(swiperight); + console.log(swipedown); + + if (swiperight == -1) { + if (newtimer_left_from >= 60) { + newtimer_left_from += 60; + newtimer_left_to += 60; + } else { // special case for 0:30 to 1:00 + newtimer_left_from = 60; + newtimer_left_to = 120; + } + newtimer_right_from += 60; + newtimer_right_to += 60; + draw(); + } else if (swiperight == 1) { + if (newtimer_left_from > 60) { + newtimer_left_from -= 60; + newtimer_left_to -= 60; + } else { // special case for 0:30 to 1:00 + newtimer_left_from = 30; + newtimer_left_to = 60; + } + + if (newtimer_right_from > 120) { + newtimer_right_from -= 60; + newtimer_right_to -= 60; + } + draw(); + } +}); + +var drawTimeout; +var showInstructions = true; + +function draw() { + g.reset(); + if (current_value >= current_to) { g.setBgColor("#F00"); } + else if (current_value >= current_mid) { g.setBgColor("#FF0"); } + else if (current_value >= current_from) { g.setBgColor("#8F8"); } + g.clearRect(0,24,176,176); + + g.reset(); + g.setFontAlign(0, 0); + + g.setFont("Michroma36").drawString(timeToString(current_value), 88, 62); + + g.setFont("HaxorNarrow7x17"); + g.drawString(timeToString(current_from), 44, 62+26); + g.drawString(timeToString(current_mid), 88, 62+26); + g.drawString(timeToString(current_to), 132, 62+26); + + if (current_value >= current_from) { g.drawRect(44-1,62+26+9,44+1,62+26+9+1); } + if (current_value >= current_mid) { g.drawRect(88-1,62+26+9,88+1,62+26+9+1); } + if (current_value >= current_to) { g.drawRect(132-1,62+26+9,132+1,62+26+9+1); } + + if (showInstructions) { + g.setFont("6x8").drawString("Tapping timer locks buttons", 88, 100+5); + g.setFont("6x8").drawString("<= Swipe to change time =>", 88, 168); + } + + g.setColor(islocked ? "#444" : "#000"); + g.setFont("Michroma16"); + g.drawString(timeToString(newtimer_left_from), 44, 138-9); + g.drawString(timeToString(newtimer_left_to), 44, 138+9); + g.drawString(timeToString(newtimer_right_from), 132, 138-9); + g.drawString(timeToString(newtimer_right_to), 132, 138+9); + + g.drawRect(0+8,138-24, 88-9+1, 138+22+1); + g.drawRect(0+8,138-24, 88-9, 138+22); + g.drawRect(88+8,138-24, 176-10+1, 138+22+1); + g.drawRect(88+8,138-24, 176-10, 138+22); +} + +require("FontHaxorNarrow7x17").add(Graphics); +g.clear(); +Bangle.loadWidgets(); +Bangle.drawWidgets(); +draw(); From 673fa8820f779a79bcfa46819990e5717a4d49ba Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:01:48 +0900 Subject: [PATCH 31/39] Add files via upload --- apps/a_speech_timer/app.png | Bin 0 -> 3036 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/a_speech_timer/app.png diff --git a/apps/a_speech_timer/app.png b/apps/a_speech_timer/app.png new file mode 100644 index 0000000000000000000000000000000000000000..1eb777fa7988b5d0a44e31d7238925f0ca47027a GIT binary patch literal 3036 zcmaJ@3p`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n+_j+*PUd8}< zXnOqVAv&FEZCwT-_PSnlQa+dWs=slz#WEIR{)@uB}_@7b(;2x8vredha zJe7jC+4mH?NlbbDdYiYTsr}}knPhBgQ2cP0=A9KM9gezN?s^ zEf>_9L#T9r1hX@fvv9N9q~iROs`j?uI7fDh)|>5==4}7AX3Xb#6VpoX!tqjL^`osJ z^7V2BX4Eb2;G5ZK=wjmaRod!%=fFO)x3Ov0tbOFGLqimbj(4QRbX{PTTP16-g6^Kw zGxR7y8W=!FqhngFVxF9(UpYMD5heW9QYY=DG5?)&nm#;pcWlp3`zy{{iy9gl`qIE} zOmAg~rLnoXRzzXj~B%aEQKeqLAH00wSCC`!wh8i%#MVt_U|M>}vK{Q@Gu{N<&}W+cQ9m7-o`4 zsLFJ(p_8KLwz*x>R8`@Pf!xQ=f0xx3SlM;2%WH^)AmVN_YFmR#N%*#S32VjC~%Lglw6 z#l^)r{Xks1QpxqLw(IWQu>NpWGqqmnqH+6nH*gYU# yJ4%fcGfsA|u23h2XeHGe^>e7deLFk-@M$Mu_WQQ7zPGYpR9h=2YN^G+xW54KKFVwW literal 0 HcmV?d00001 From 9033db08bf1a56d1f852a60795eb75d2bdee0f70 Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:03:45 +0900 Subject: [PATCH 32/39] Create app-icon.js --- apps/a_speech_timer/app-icon.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/a_speech_timer/app-icon.js diff --git a/apps/a_speech_timer/app-icon.js b/apps/a_speech_timer/app-icon.js new file mode 100644 index 000000000..1fdb2c509 --- /dev/null +++ b/apps/a_speech_timer/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwgP//kAj//AAP5/+PApH7//PAonvAoXzAonj//nApHggEHAoWAgA5BAAJCCAoU/IYIFCv///w0CAonrv/HAoXLv+DAogLFgPeAoV+nlOAoV4/8+AoV79+eFIVzAof7u/v5xBCs4FL84FE//O74FBu4FB64FD73TAoNz/+eAoV5IIIFCvl8vwFCv8A/wFDO4IFFFIQFCGoSVFUIqtDh65D/1vYof+Y4LLDw7dD/0ndIYRCeoQFC/P/z/+i///oFBGoX8gEfAgI=")) From da133e2ccd7ee837d078430095733180929fff4b Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:09:06 +0900 Subject: [PATCH 33/39] Create ChangeLog --- apps/a_speech_timer/ChangeLog | 1 + 1 file changed, 1 insertion(+) create mode 100644 apps/a_speech_timer/ChangeLog diff --git a/apps/a_speech_timer/ChangeLog b/apps/a_speech_timer/ChangeLog new file mode 100644 index 000000000..4a8e3fbe7 --- /dev/null +++ b/apps/a_speech_timer/ChangeLog @@ -0,0 +1 @@ +1.00: Release (2021/12/01) From 18c3461e6e4191433897f3b1e10a9f68f7b97fa8 Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:20:41 +0900 Subject: [PATCH 34/39] Create README.md --- apps/a_speech_timer/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 apps/a_speech_timer/README.md diff --git a/apps/a_speech_timer/README.md b/apps/a_speech_timer/README.md new file mode 100644 index 000000000..98d2d4517 --- /dev/null +++ b/apps/a_speech_timer/README.md @@ -0,0 +1,12 @@ +# A Speech Timer + +* A timer designed to help keeping your speeches and presentations to time +* Vibrates 1-2-3 times and changes screen color within the target time range. + * Example for a 5 to 7 minutes speech: vibrates once at 5:00 (green), twice at 6:00 (yellow), thrice at 7:00 (red). +* Use the buttons to start a timer +* Swipe left or right to choose different target times + +![](screenshot.png) + +## Creator +[@alainsaas](https://github.com/alainsaas) From 13b01fe82955ca3ba595ed115fd1bfc6acd7a4fc Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:20:52 +0900 Subject: [PATCH 35/39] Add files via upload --- apps/a_speech_timer/screenshot0.png | Bin 0 -> 3276 bytes apps/a_speech_timer/screenshot1.png | Bin 0 -> 3457 bytes apps/a_speech_timer/screenshot2.png | Bin 0 -> 3401 bytes apps/a_speech_timer/screenshot3.png | Bin 0 -> 3374 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 apps/a_speech_timer/screenshot0.png create mode 100644 apps/a_speech_timer/screenshot1.png create mode 100644 apps/a_speech_timer/screenshot2.png create mode 100644 apps/a_speech_timer/screenshot3.png diff --git a/apps/a_speech_timer/screenshot0.png b/apps/a_speech_timer/screenshot0.png new file mode 100644 index 0000000000000000000000000000000000000000..ee3ababc1abf849d688e97c5ceb8d3ae8180f05c GIT binary patch literal 3276 zcmd5<`#;l*8~jKfgS$_v`gMneL}u6rlT{001Z) z{{wwSf_49334Aan#Er=%n$g`HYonYln1 zTHPr^rL=8wb`~sChx&Ui1*bSb;>`1easbz)kF3cLGOp0=@KuOBN-mLk&iXM%>fZhS z`6*KUGeoSs`>FVq%4SX?es1zNE>j>L*L;yFf2GRfWosr$8c+SVnG_w=RmsK)4lOoh zlqpP=-P@j1+#2o$#N{h8F;m5%`x&eKc%Zd^a0QY4@kjce7{Q&<3;tvGtO($S|H>CcyT=T7EA(DBOFYRxGSO(|>Mf zGt?ip{R6*hp?MLujK48m=tudphK52y46I{pX>6qe;}4L#{dV65OKV~kY=>_uucWsW zqhkXPhBTgT_ia*klNHlfn(n$2T6t8_+?N^FB;;=yg>k8(0zW~(5kqnbQv{!9q-9;E z#^40^uft zTG4%01N34z!DoZ79>v4F>P`3D*!h0W;zqkwE4iVaI>Ya%_c++p4236`u3BPy`PXdk z4zorI6b}g1YF7=J@$b>6%QM6tDFx4ZxBQD$_rj+_1FB{)QWJ@1ZGLK1=>-20lfaST zKeeINkInc?`E&fpz$F0YeZcHYUX+mj5aRc;3m zxgxo}U%Jg6bqTzY0t2VD6|d_`7-T12Q=QR%=Aeo)_W{K;u!aHz)U;pxf1~!7DOKdb z8zNN#@gz&1|21K-6+f5RQK&e@%G#xqa)a2PRUxB)!cqDI|Be?>c22Gd@SV1`&O_*8 zj>$}Xv{2xB8=$I*W}Ux+9(K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SRg^+^QE2E$kRlI0^GnfoCUm5G`=u$)39P#SODgc<_tcyD|px z^BDOr6ZoW=5It_OTC9WNfXh~eR{3%cU%)WV6W~qKMH%q0UD$HJ{*v{|w%5(d^qz+U zVDTI6@lQT`0?=f_%gTaWbGZ+q7)s$d&2B(lstytnBkQF3;&*O{i1Q~`8^MU*pFe`~ zS!$XN0R=DA)~ZC?pXO0(vBj}vxd8xwjj_xEoTqr|#0OS4a@p5v=io~W&aH;w9eIk& zC&aVV`=dzra7XLIR+l2&_82MecZ;KNmI96kHpYQl%J-;*e|CS5l^?&aO`2Md%n>Vd zr;53={;RQbdeUSJu literal 0 HcmV?d00001 diff --git a/apps/a_speech_timer/screenshot1.png b/apps/a_speech_timer/screenshot1.png new file mode 100644 index 0000000000000000000000000000000000000000..69ea91e95332e8b97e6de3205f72319215bd6195 GIT binary patch literal 3457 zcmcha`8(U&_QyY;h@n)>s#=2RrKVPWmC~YU(?Lm9)liY5XoDycjwzw$8jh>S(1TK{ z12IoErso)Iu1W|(Rcc5KHN?!#xqrd^>HEXp>)C7Vz4m^d_g?#X?RbWm@xwibDCcww-%j#y)Tm$-BBTa$Q{?iNGNrpGgui6BmmvV-JC)AEdrEL-CIqOA* zQGkwV7lzP38K3(5_10*%_r=%5!~LE0{G&pOnbfudPprEV5ISSdc(62iQUIve-Ee}78x&u-!5@2b>FodGrTBRFnRg;#O7Ih3`VI4WXfw?&>O{*~1(AA7ESqWl{GjC9}s_^6T+B5@SVMgf1j)+xt)Kzz9wMXw>U#{8<=Myj{Pvr5>6^ zD4nSpwDZ&#Z}h>9Dv=VV)vb8(N?V19Zw=JqboyLm_x6^HYE^qG`NVWGg@q~Y7 zKo@4iCQ#?}~QjPDAuFF-5K;Km7NGfCQ`T3wBmA87$~%SQ>M@-ks~@0|&r;o%D02j>A4Tt3X7*na+ggmaPE3Nw(zwda^r>{6~HRC{flNXW$lRKFjc?@Io zX^MtmJzKgsGqrIuTgru{JsJ5_+Dpv!*z?a_3pT7-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#IVGd;=%D$&HYS zmy&2zoM)Ld-6P92;h*Dw(%Tgp5!jsvL%FH+=)3v5qR733Mi*$K#*tbIo>5?SW+f#t zKqch}@*G$*O$65Dd~d-@)w!bz(0QIP7N?1d6S(-7Ij6@mXOf6MAoy+EQAf?i6wnay fvD^PYu@6C|G?r|FX*!YfHv()d?XT3BqaOYXrs`nl literal 0 HcmV?d00001 diff --git a/apps/a_speech_timer/screenshot3.png b/apps/a_speech_timer/screenshot3.png new file mode 100644 index 0000000000000000000000000000000000000000..7b67b6f0156354dc839f5194e1a1fbc1c54ed9a1 GIT binary patch literal 3374 zcmb`KXIRt8x5s};2-1aJ0*Ew;g&IN;k&cw8t017XM2hqtI)oMwPyrKJQLxaf3xPlk zxJro%gas7C8X!S1N-qIoU;$a>=Kk;7d*9u8o|*GJb7szYanARd&)m7{dj6axT2 z^1^vL7l9@J_Y@HptgW4M-U0)Pb3vU0THY%y1AxTR1v{Io$==*DM&hiRgx%D^!P0t+ zi`P(gaE?%i-}mQe__4bPu-OIv-nL*=scLRsfm%X0ZM7T7K4OK3cKQ6-+1Ze96{@Nz zir&G7PT%72=lxTWC#j#$HWcka#cIdO%VbUh|9YM3l|EG(*QopzBZ;-lEEi5Sps>+& zbZz8b$F9lI;jrJ+0=k!(`(aiGpu*pgP+l0JSGoNWW>H_M-z#yU@!VWSm$fICG|PJG zsq2|Zijm8Z!e<(DC#3d!C#(RBDm*6z~kE6}IxWOJI8Vdm#SNmIyT z!8-obYxC;;9#@>+$V~q_wL%j4YKm&~dauWD$Sh(eD;mJo^(K_3>z2iS^uXL}!~1}+ zk!|%sS@A)Hgn9ihDyZANN#>cV&#Id5th!s|lED~4CmXJL&#E37yw4;izi}dwd~( z|LkYJ!kKrjN~mC%x_AJHV|jW3&!v_!lMW6lPJV)Nl!2pVaPSLr;o>vzLW1RJHQFIt zL@`1lw8=v3@ZQnL(eJ3rTgu0V)`#Lli~BB4$RNSH(NvbyQ>#0b(OpFsstEa@J}jOk7DN*e6`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H*A%Ftj_UHQ++_7wTUY#h^y9sk48`ZKLUdKp*Zw5R{&(<{SzNEph9FH+mshq bvNGFCP4eAd222Y+K)?liN4u7DzS;i;FilcV literal 0 HcmV?d00001 From 8f0856d8716af6e1058a9923e0e5850734303d72 Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:21:21 +0900 Subject: [PATCH 36/39] Update README.md --- apps/a_speech_timer/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/a_speech_timer/README.md b/apps/a_speech_timer/README.md index 98d2d4517..a6568649f 100644 --- a/apps/a_speech_timer/README.md +++ b/apps/a_speech_timer/README.md @@ -6,7 +6,10 @@ * Use the buttons to start a timer * Swipe left or right to choose different target times -![](screenshot.png) +![](screenshot0.png) +![](screenshot1.png) +![](screenshot2.png) +![](screenshot3.png) ## Creator [@alainsaas](https://github.com/alainsaas) From 541adf4c16c7bf2e522c3343b7675831b9e13343 Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:22:44 +0900 Subject: [PATCH 37/39] Update README.md --- apps/a_speech_timer/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/a_speech_timer/README.md b/apps/a_speech_timer/README.md index a6568649f..098c352f3 100644 --- a/apps/a_speech_timer/README.md +++ b/apps/a_speech_timer/README.md @@ -5,6 +5,7 @@ * Example for a 5 to 7 minutes speech: vibrates once at 5:00 (green), twice at 6:00 (yellow), thrice at 7:00 (red). * Use the buttons to start a timer * Swipe left or right to choose different target times +* Touching the timer on the upper part of the screen locks (or unlocks) the buttons to prevent accidental changes ![](screenshot0.png) ![](screenshot1.png) From 3507dcde457b78beede4ee033af1f38090a1a71d Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:26:52 +0900 Subject: [PATCH 38/39] Update apps.json --- apps.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps.json b/apps.json index 36102264e..cb8a460f7 100644 --- a/apps.json +++ b/apps.json @@ -4557,5 +4557,19 @@ { "name": "sensible.app.js", "url": "sensible.js" }, { "name": "sensible.img", "url": "sensible-icon.js", "evaluate": true } ] +}, +{ + "id":"a_speech_timer", + "name":"A Speech TImer", + "icon": "app.png", + "version":"1.00", + "description": "A timer designed to help keeping your speeches and presentations to time.", + "tags": "tool,timer", + "readme":"README.md", + "supports":["BANGLEJS2"], + "storage": [ + {"name":"a_speech_timer.app.js","url":"app.js"}, + {"name":"a_speech_timer.img","url":"app-icon.js","evaluate":true} + ] } ] From 3c7d6b795d50aac5d6c3945a4a9af1ee013154ad Mon Sep 17 00:00:00 2001 From: Alain Saas Date: Wed, 1 Dec 2021 15:28:23 +0900 Subject: [PATCH 39/39] Update apps.json --- apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.json b/apps.json index cb8a460f7..50f02c953 100644 --- a/apps.json +++ b/apps.json @@ -4560,7 +4560,7 @@ }, { "id":"a_speech_timer", - "name":"A Speech TImer", + "name":"A Speech Timer", "icon": "app.png", "version":"1.00", "description": "A timer designed to help keeping your speeches and presentations to time.",