diff --git a/apps/mixdiganclock/ChangeLog b/apps/mixdiganclock/ChangeLog index 13f27c06c..8ef626dd7 100644 --- a/apps/mixdiganclock/ChangeLog +++ b/apps/mixdiganclock/ChangeLog @@ -1,4 +1,5 @@ 0.01: fork from miclock, Added compatib with b widgets, devices(dynamic x,y) and themes(dynamic colors) 0.02: Code refactored, change colors in real time 0.03: Hour point size can be modified on real time. -0.04: Background color can be changed on real time, it will change also the list of fg color \ No newline at end of file +0.04: Background color can be changed on real time, it will change also the list of fg color +0.05: Main button can access to Messages, small improvements \ No newline at end of file diff --git a/apps/mixdiganclock/README.md b/apps/mixdiganclock/README.md index d5efbc126..7b9fb2ff0 100644 --- a/apps/mixdiganclock/README.md +++ b/apps/mixdiganclock/README.md @@ -9,6 +9,13 @@ Compatible with BangleJS1,BangleJS2,and EMSCRIPTENx emulators Bangle.JS1 ![](photo_mixdigan_bjs1.jpg) + +UI for bangleJS1 +![](bangle.js_UI.png) + +UI for bangleJS2 +![](bangle.js2_UI.png) + Screenshot emulator (BJS2) ![](ss_mixdigan_ems2.png) @@ -36,19 +43,26 @@ Open and see ## Features -Compatibility with devices -Dynamic positions x,y for different devices -Dynamic Colours (FG and BG) and positions -Support for bottom widgets + - Compatibility with different smartwatch models + - Dynamic positions x,y for different devices + - Dynamic Colours (FG and BG) and positions + - Realtime configuration + - Support for bottom widgets + - Shortcut to messages app -## Controls +## Controls/UI -Exit : BTN2 (BJS1) -Exit/launcher : left area -Change FG Color : right area -Increase/Decrease Hour circle/Points : swipe right -Change BG Color : swipe left + - BTN1 (BJS2): "Launcher" / open "Messages" + - BTN2 (BJS1): "Launcher" / open "Messages" + - BTN1 (BJS1): Change FG Color + - BTN3 (BJS1): Change BG Color + - Left area: Back/Exit/launcher + - Right area: Change FG Color + - Swipe left: Change BG Color + - Swipe right: Increase/Decrease Hour circle/Points + + - BTN3 (long press)(BJS1): default Exit/kill app ## Coming soon diff --git a/apps/mixdiganclock/bangle.js2_UI.png b/apps/mixdiganclock/bangle.js2_UI.png new file mode 100644 index 000000000..0c0f37fb5 Binary files /dev/null and b/apps/mixdiganclock/bangle.js2_UI.png differ diff --git a/apps/mixdiganclock/bangle.js_UI.png b/apps/mixdiganclock/bangle.js_UI.png new file mode 100644 index 000000000..d4e5df6d2 Binary files /dev/null and b/apps/mixdiganclock/bangle.js_UI.png differ diff --git a/apps/mixdiganclock/metadata.json b/apps/mixdiganclock/metadata.json index daf0924ec..2f6d049eb 100644 --- a/apps/mixdiganclock/metadata.json +++ b/apps/mixdiganclock/metadata.json @@ -1,8 +1,8 @@ { "id": "mixdiganclock", "name": "Mix Dig&Anal Clock", - "version": "0.04", - "description": "A dual Analog and Digital Clock, that gives the user the power to improve the UI/UX on realtime. Too much sun and polarized sunglasses should not be a problem to read the time anymore if you change colors or aspect. Originally based in Mixed Clock ", + "version": "0.05", + "description": "A dual Analog, Digital Clock, that gives the user the power to improve the aspect on realtime. Too much sun and/or polarized sunglasses? Not be a problem anymore to see the time. Originally based in Mixed Clock ", "icon": "mixdiganclock.png", "type": "clock", "tags": "clock", diff --git a/apps/mixdiganclock/mixdiganclock.app.js b/apps/mixdiganclock/mixdiganclock.app.js index 940e1a7e2..da2c22f18 100644 --- a/apps/mixdiganclock/mixdiganclock.app.js +++ b/apps/mixdiganclock/mixdiganclock.app.js @@ -2,7 +2,7 @@ compatible with BJS1, BJS2 and bottom widgets */ var locale = require("locale"); -var v_mode_debug=0 //, 0=no, 1 min, 2 prone detail +var v_mode_debug=0; //, 0=no, 1 min, 2 prone detail var v_model=process.env.BOARD; var v_array4colors=0; // 0 undef, 1 forDark, 2 forLight var a_colors=[]; //new Array(), values will depend on b_isarray4dark @@ -23,8 +23,25 @@ var v_center_y; g.clear(); //ONLY 1ST TIME //show the exit button -Bangle.setUI("clock"); //implies center button for launcher +function setMainBtn() { +//if messages app installed shortcut otherwise default access to launcher +if (require("Storage").read("messagegui.app.js")===undefined) +{ + if (require("Storage").read("messagelist.app.js")===undefined) Bangle.setUI("clock"); // implies btn2(js1) btn(js2)- launcher + else if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') setWatch(function (){load("messagelist.app.js");}, BTN2, { repeat: true }); + else setWatch(function (){load("messagelist.app.js");}, BTN1, { repeat: true }); +} +else if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') setWatch(function (){load("messagegui.app.js");}, BTN2, { repeat: true }); + else setWatch(function (){load("messagegui.app.js");}, BTN1, { repeat: true }); +} + +function setBJS1Btns() { + //only for bjs1, btns complementary to touch + setWatch(changeFGcolor, BTN1, { repeat: true }); + setWatch(changeBGcolor, BTN3, { repeat: true }); + } + Bangle.loadWidgets(); function getColorArray4BG() { //1st=0 1st compatible color (dark/light theme) @@ -211,6 +228,42 @@ function drawMixedClock() { g.setColor(a_colors[v_color1]); g.fillCircle(v_center_x, v_center_y, Radius.center); } + +function changeFGcolor(){ + //change color but monocolor watchface + if (v_mode_debug>0) console.log("v_count_col/total: "+v_count_col+"/"+a_colors.length); + if (v_count_col0) console.log("paint on color: "+v_count_col); + drawStaticRing(a_colors[v_color1]); + drawDailyTxt(); +} +function changeBGcolor(){ + //pend to refactor + //if black bg + if (v_array4colors==1) v_array4colors=2; // then white + else if (v_array4colors==2) v_array4colors=1; //if white bg + getColorArray4BG(); //set new list of colors + g.setBgColor( v_color_erase);// 0 white, 1 black + ClearScreen(); + //g.clear();//impact on widgets + drawStaticRing(a_colors[v_color1]); + drawDailyTxt(); //1st time + drawMixedClock(); +} +function changeRadiusRing(){ + drawStaticRing(v_color_erase); + if (Radius.circleH<13) Radius.circleH++; + else Radius.circleH=2; + if (v_mode_debug>0) console.log("radio: "+Radius.circleH); + drawStaticRing(a_colors[v_color1]); +} + function UserInput(){ Bangle.on('touch', function(button){ switch(button){ @@ -218,55 +271,21 @@ function UserInput(){ Bangle.showLauncher(); break; case 2: - //change color but monocolor watchface - if (v_mode_debug>0) console.log("v_count_col/total: "+v_count_col+"/"+a_colors.length); - if (v_count_col0) console.log("paint on color: "+v_count_col); - drawStaticRing(a_colors[v_color1]); - drawDailyTxt(); + changeFGcolor(); break; case 3: //console.log("Touch 3 aka 1+2 not for BJS1 emul");//center 1+2 break; } }); - //changing dimensions + //changing dimensions right Bangle.on('swipe', dir => { if(dir == 1) { - drawStaticRing(v_color_erase); - if (Radius.circleH<13) Radius.circleH++ - else Radius.circleH=2; - if (v_mode_debug>0) console.log("radio: "+Radius.circleH); - drawStaticRing(a_colors[v_color1]); - } - else { //swipe left, pend to refactor - if (v_array4colors==1) { //if black bg - v_array4colors=2; // then white - getColorArray4BG(); //set new list of colors - g.setBgColor( v_color_erase);// 0 white, 1 black - ClearScreen(); - //g.clear();//impact on widgets - drawStaticRing(a_colors[v_color1]); - drawDailyTxt(); //1st time - drawMixedClock(); - } else if (v_array4colors==2) { //if white bg - v_array4colors=1; - getColorArray4BG(); - console.log(a_colors[1]); - g.setBgColor(v_color_erase);// 0 white, 1 black - //g.clear(); - ClearScreen(); - drawStaticRing(a_colors[v_color1]); - drawDailyTxt(); //1st time - drawMixedClock(); //or just wait? - } + changeRadiusRing(); } + else { //swipe left,bg color + changeBGcolor(); + } }); } Bangle.on('lcdPower', function(on) { @@ -274,9 +293,11 @@ Bangle.on('lcdPower', function(on) { drawMixedClock(); }); +setMainBtn(); //assign btn to messages when installed setVariables(); Bangle.drawWidgets(); UserInput(); +if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') setBJS1Btns(); //assign btn1 and btn3 setInterval(drawMixedClock, 30000);//not realtime update drawStaticRing(a_colors[v_color1]); drawDailyTxt(); diff --git a/apps/mixdiganclock/mixdiganclock.info b/apps/mixdiganclock/mixdiganclock.info deleted file mode 100644 index 9675614c1..000000000 --- a/apps/mixdiganclock/mixdiganclock.info +++ /dev/null @@ -1 +0,0 @@ -{"id":"mixdiganclock","name":"Mix Dig&Anal","type":"clock","src":"mixdiganclock.app.js","icon":"mixdiganclock.img","version":"0.04","tags":"clock","files":"mixdiganclock.info,mixdiganclock.app.js,mixdiganclock.img"} \ No newline at end of file diff --git a/apps/mixdiganclock/photo_mixdigan_bjs1.jpg b/apps/mixdiganclock/photo_mixdigan_bjs1.jpg index 023183a59..a3d590647 100644 Binary files a/apps/mixdiganclock/photo_mixdigan_bjs1.jpg and b/apps/mixdiganclock/photo_mixdigan_bjs1.jpg differ