parent
716af7c18b
commit
2921ca331e
|
|
@ -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
|
||||||
|
|
@ -9,6 +9,13 @@ Compatible with BangleJS1,BangleJS2,and EMSCRIPTENx emulators
|
||||||
Bangle.JS1
|
Bangle.JS1
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
UI for bangleJS1
|
||||||
|

|
||||||
|
|
||||||
|
UI for bangleJS2
|
||||||
|

|
||||||
|
|
||||||
Screenshot emulator (BJS2)
|
Screenshot emulator (BJS2)
|
||||||

|

|
||||||
|
|
||||||
|
|
@ -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 |
|
|
@ -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",
|
||||||
|
|
|
||||||
|
|
@ -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,6 +228,42 @@ 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 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(){
|
function UserInput(){
|
||||||
Bangle.on('touch', function(button){
|
Bangle.on('touch', function(button){
|
||||||
switch(button){
|
switch(button){
|
||||||
|
|
@ -218,55 +271,21 @@ function UserInput(){
|
||||||
Bangle.showLauncher();
|
Bangle.showLauncher();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
//change color but monocolor watchface
|
changeFGcolor();
|
||||||
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();
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
//console.log("Touch 3 aka 1+2 not for BJS1 emul");//center 1+2
|
//console.log("Touch 3 aka 1+2 not for BJS1 emul");//center 1+2
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//changing dimensions
|
//changing dimensions right
|
||||||
Bangle.on('swipe', dir => {
|
Bangle.on('swipe', dir => {
|
||||||
if(dir == 1) {
|
if(dir == 1) {
|
||||||
drawStaticRing(v_color_erase);
|
changeRadiusRing();
|
||||||
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
|
else { //swipe left,bg color
|
||||||
if (v_array4colors==1) { //if black bg
|
changeBGcolor();
|
||||||
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?
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
|
|
@ -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();
|
||||||
|
|
|
||||||
|
|
@ -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 |
Loading…
Reference in New Issue