v005 Mixdiganclock

Main button can access to Messages, small improvements
master
dapgo 2023-02-16 13:04:18 +01:00
parent 716af7c18b
commit 2921ca331e
8 changed files with 91 additions and 56 deletions

View File

@ -2,3 +2,4 @@
0.02: Code refactored, change colors in real time 0.02: Code refactored, change colors in real time
0.03: Hour point size can be modified on 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 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

View File

@ -9,6 +9,13 @@ Compatible with BangleJS1,BangleJS2,and EMSCRIPTENx emulators
Bangle.JS1 Bangle.JS1
![](photo_mixdigan_bjs1.jpg) ![](photo_mixdigan_bjs1.jpg)
UI for bangleJS1
![](bangle.js_UI.png)
UI for bangleJS2
![](bangle.js2_UI.png)
Screenshot emulator (BJS2) Screenshot emulator (BJS2)
![](ss_mixdigan_ems2.png) ![](ss_mixdigan_ems2.png)
@ -36,19 +43,26 @@ Open and see
## Features ## Features
Compatibility with devices - Compatibility with different smartwatch models
Dynamic positions x,y for different devices - Dynamic positions x,y for different devices
Dynamic Colours (FG and BG) and positions - Dynamic Colours (FG and BG) and positions
Support for bottom widgets - Realtime configuration
- Support for bottom widgets
- Shortcut to messages app
## Controls ## Controls/UI
Exit : BTN2 (BJS1) - BTN1 (BJS2): "Launcher" / open "Messages"
Exit/launcher : left area - BTN2 (BJS1): "Launcher" / open "Messages"
Change FG Color : right area - BTN1 (BJS1): Change FG Color
Increase/Decrease Hour circle/Points : swipe right - BTN3 (BJS1): Change BG Color
Change BG Color : swipe left - 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 ## Coming soon

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -1,8 +1,8 @@
{ {
"id": "mixdiganclock", "id": "mixdiganclock",
"name": "Mix Dig&Anal Clock", "name": "Mix Dig&Anal Clock",
"version": "0.04", "version": "0.05",
"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 ", "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", "icon": "mixdiganclock.png",
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock",

View File

@ -2,7 +2,7 @@
compatible with BJS1, BJS2 and bottom widgets compatible with BJS1, BJS2 and bottom widgets
*/ */
var locale = require("locale"); 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_model=process.env.BOARD;
var v_array4colors=0; // 0 undef, 1 forDark, 2 forLight var v_array4colors=0; // 0 undef, 1 forDark, 2 forLight
var a_colors=[]; //new Array(), values will depend on b_isarray4dark var a_colors=[]; //new Array(), values will depend on b_isarray4dark
@ -23,7 +23,24 @@ var v_center_y;
g.clear(); //ONLY 1ST TIME g.clear(); //ONLY 1ST TIME
//show the exit button //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(); Bangle.loadWidgets();
@ -211,13 +228,8 @@ function drawMixedClock() {
g.setColor(a_colors[v_color1]); g.setColor(a_colors[v_color1]);
g.fillCircle(v_center_x, v_center_y, Radius.center); g.fillCircle(v_center_x, v_center_y, Radius.center);
} }
function UserInput(){
Bangle.on('touch', function(button){ function changeFGcolor(){
switch(button){
case 1:
Bangle.showLauncher();
break;
case 2:
//change color but monocolor watchface //change color but monocolor watchface
if (v_mode_debug>0) console.log("v_count_col/total: "+v_count_col+"/"+a_colors.length); if (v_mode_debug>0) console.log("v_count_col/total: "+v_count_col+"/"+a_colors.length);
if (v_count_col<a_colors.length){ if (v_count_col<a_colors.length){
@ -230,24 +242,12 @@ function UserInput(){
if (v_mode_debug>0) console.log("paint on color: "+v_count_col); if (v_mode_debug>0) console.log("paint on color: "+v_count_col);
drawStaticRing(a_colors[v_color1]); drawStaticRing(a_colors[v_color1]);
drawDailyTxt(); drawDailyTxt();
break;
case 3:
//console.log("Touch 3 aka 1+2 not for BJS1 emul");//center 1+2
break;
} }
}); function changeBGcolor(){
//changing dimensions //pend to refactor
Bangle.on('swipe', dir => { //if black bg
if(dir == 1) { if (v_array4colors==1) v_array4colors=2; // then white
drawStaticRing(v_color_erase); else if (v_array4colors==2) v_array4colors=1; //if white bg
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 getColorArray4BG(); //set new list of colors
g.setBgColor( v_color_erase);// 0 white, 1 black g.setBgColor( v_color_erase);// 0 white, 1 black
ClearScreen(); ClearScreen();
@ -255,17 +255,36 @@ function UserInput(){
drawStaticRing(a_colors[v_color1]); drawStaticRing(a_colors[v_color1]);
drawDailyTxt(); //1st time drawDailyTxt(); //1st time
drawMixedClock(); 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?
} }
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){
case 1:
Bangle.showLauncher();
break;
case 2:
changeFGcolor();
break;
case 3:
//console.log("Touch 3 aka 1+2 not for BJS1 emul");//center 1+2
break;
}
});
//changing dimensions right
Bangle.on('swipe', dir => {
if(dir == 1) {
changeRadiusRing();
}
else { //swipe left,bg color
changeBGcolor();
} }
}); });
} }
@ -274,9 +293,11 @@ Bangle.on('lcdPower', function(on) {
drawMixedClock(); drawMixedClock();
}); });
setMainBtn(); //assign btn to messages when installed
setVariables(); setVariables();
Bangle.drawWidgets(); Bangle.drawWidgets();
UserInput(); UserInput();
if (v_model=='BANGLEJS'||v_model=='EMSCRIPTEN') setBJS1Btns(); //assign btn1 and btn3
setInterval(drawMixedClock, 30000);//not realtime update setInterval(drawMixedClock, 30000);//not realtime update
drawStaticRing(a_colors[v_color1]); drawStaticRing(a_colors[v_color1]);
drawDailyTxt(); drawDailyTxt();

View File

@ -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"}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 81 KiB