v005 Mixdiganclock

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

View File

@ -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
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
![](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

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",
"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",

View File

@ -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_col<a_colors.length){
v_color1=v_count_col;
v_color2=v_count_col;
v_color3=v_count_col;
v_count_col++; //next color
}
else setVariables(); //v_count_col=3; //reset to 1st common color
if (v_mode_debug>0) 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_col<a_colors.length){
v_color1=v_count_col;
v_color2=v_count_col;
v_color3=v_count_col;
v_count_col++; //next color
}
else setVariables(); //v_count_col=3; //reset to 1st common color
if (v_mode_debug>0) 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();

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