Merge remote-tracking branch 'upstream/master'
commit
044ffe945b
31
apps.json
31
apps.json
|
|
@ -51,6 +51,19 @@
|
||||||
],
|
],
|
||||||
"sortorder" : -10
|
"sortorder" : -10
|
||||||
},
|
},
|
||||||
|
{ "id": "launchb2",
|
||||||
|
"name": "Launcher (Bangle.js 2)",
|
||||||
|
"shortName":"Launcher",
|
||||||
|
"icon": "app.png",
|
||||||
|
"version":"0.01",
|
||||||
|
"description": "This is needed by Bangle.js 2.0 to display a menu allowing you to choose your own applications. It will not work on Bangle.js 1.0.",
|
||||||
|
"tags": "tool,system,launcher,b2,bno1",
|
||||||
|
"type":"launch",
|
||||||
|
"storage": [
|
||||||
|
{"name":"launchb2.app.js","url":"app.js"}
|
||||||
|
],
|
||||||
|
"sortorder" : -10
|
||||||
|
},
|
||||||
{ "id": "about",
|
{ "id": "about",
|
||||||
"name": "About",
|
"name": "About",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
|
|
@ -172,7 +185,7 @@
|
||||||
{ "id": "setting",
|
{ "id": "setting",
|
||||||
"name": "Settings",
|
"name": "Settings",
|
||||||
"icon": "settings.png",
|
"icon": "settings.png",
|
||||||
"version":"0.26",
|
"version":"0.27",
|
||||||
"description": "A menu for setting up Bangle.js",
|
"description": "A menu for setting up Bangle.js",
|
||||||
"tags": "tool,system,b2",
|
"tags": "tool,system,b2",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
@ -340,7 +353,7 @@
|
||||||
"icon": "clock.png",
|
"icon": "clock.png",
|
||||||
"version":"0.03",
|
"version":"0.03",
|
||||||
"description": "7 segment clock with animated background in the style of Ryan Geiss' music visualisation. NOTE: The first run will take ~1 minute to do some precalculation",
|
"description": "7 segment clock with animated background in the style of Ryan Geiss' music visualisation. NOTE: The first run will take ~1 minute to do some precalculation",
|
||||||
"tags": "clock,nob2",
|
"tags": "clock,bno2",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"geissclk.app.js","url":"clock.js"},
|
{"name":"geissclk.app.js","url":"clock.js"},
|
||||||
|
|
@ -1170,7 +1183,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.03",
|
"version":"0.03",
|
||||||
"description": "Watch-centered digital 24h clock with date in dd.mm.yyyy format.",
|
"description": "Watch-centered digital 24h clock with date in dd.mm.yyyy format.",
|
||||||
"tags": "clock,nob2",
|
"tags": "clock,bno2",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
@ -1210,7 +1223,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version": "0.04",
|
"version": "0.04",
|
||||||
"description": "Pipboy themed clock",
|
"description": "Pipboy themed clock",
|
||||||
"tags": "clock,nob2",
|
"tags": "clock,bno2",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
"allow_emulator":true,
|
"allow_emulator":true,
|
||||||
"storage": [
|
"storage": [
|
||||||
|
|
@ -2143,7 +2156,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.03",
|
"version":"0.03",
|
||||||
"description": "An animated clock face using Mark Ferrari's amazing 8 bit game art and palette cycling: http://www.markferrari.com/art/8bit-game-art",
|
"description": "An animated clock face using Mark Ferrari's amazing 8 bit game art and palette cycling: http://www.markferrari.com/art/8bit-game-art",
|
||||||
"tags": "clock,animated,nob2",
|
"tags": "clock,animated,bno2",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"animclk.app.js","url":"app.js"},
|
{"name":"animclk.app.js","url":"app.js"},
|
||||||
|
|
@ -2159,7 +2172,7 @@
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.03",
|
"version":"0.03",
|
||||||
"description": "An analog clock with an image background",
|
"description": "An analog clock with an image background",
|
||||||
"tags": "clock,nob2",
|
"tags": "clock,bno2",
|
||||||
"type": "clock",
|
"type": "clock",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"analogimgclk.app.js","url":"app.js"},
|
{"name":"analogimgclk.app.js","url":"app.js"},
|
||||||
|
|
@ -2172,7 +2185,7 @@
|
||||||
"name": "Vertical watch face",
|
"name": "Vertical watch face",
|
||||||
"shortName":"Vertical Face",
|
"shortName":"Vertical Face",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"version":"0.08",
|
"version":"0.09",
|
||||||
"description": "A simple vertical watch face with the date. Heart rate monitor is toggled with BTN1",
|
"description": "A simple vertical watch face with the date. Heart rate monitor is toggled with BTN1",
|
||||||
"tags": "clock",
|
"tags": "clock",
|
||||||
"type":"clock",
|
"type":"clock",
|
||||||
|
|
@ -2497,7 +2510,7 @@
|
||||||
"icon": "digiclock.png",
|
"icon": "digiclock.png",
|
||||||
"version":"0.02",
|
"version":"0.02",
|
||||||
"description": "A simple digital clock with the time, day, month, and year",
|
"description": "A simple digital clock with the time, day, month, and year",
|
||||||
"tags": "clock,nob2",
|
"tags": "clock,bno2",
|
||||||
"type" : "clock",
|
"type" : "clock",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"digiclock.app.js","url":"digiclock.js"},
|
{"name":"digiclock.app.js","url":"digiclock.js"},
|
||||||
|
|
@ -3051,7 +3064,7 @@
|
||||||
"version":"0.01",
|
"version":"0.01",
|
||||||
"description": "Displays RGB565 and RGB888 colors, its name and code in screen.",
|
"description": "Displays RGB565 and RGB888 colors, its name and code in screen.",
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
"tags": "Color,input,buttons,touch,UI,nob2",
|
"tags": "Color,input,buttons,touch,UI,bno2",
|
||||||
"storage": [
|
"storage": [
|
||||||
{"name":"color_catalog.app.js","url":"app.js"},
|
{"name":"color_catalog.app.js","url":"app.js"},
|
||||||
{"name":"color_catalog.img","url":"app-icon.js","evaluate":true}
|
{"name":"color_catalog.img","url":"app-icon.js","evaluate":true}
|
||||||
|
|
|
||||||
|
|
@ -37,5 +37,7 @@ g.drawString(NRF.getAddress(),g.getWidth()/2,g.getHeight()-8,true);
|
||||||
g.flip();
|
g.flip();
|
||||||
|
|
||||||
setWatch(_=>load(), BTN1);
|
setWatch(_=>load(), BTN1);
|
||||||
setWatch(_=>load(), BTN2);
|
if (global.BTN2) {
|
||||||
setWatch(_=>load(), BTN3);
|
setWatch(_=>load(), BTN2);
|
||||||
|
setWatch(_=>load(), BTN3);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ function getTrackList() {
|
||||||
Util.showModal("Loading Tracks...");
|
Util.showModal("Loading Tracks...");
|
||||||
domTracks.innerHTML = "";
|
domTracks.innerHTML = "";
|
||||||
Puck.write(`\x10(function() {
|
Puck.write(`\x10(function() {
|
||||||
|
Bluetooth.println("");
|
||||||
for (var n=0;n<36;n++) {
|
for (var n=0;n<36;n++) {
|
||||||
var f = require("Storage").open(".gpsrc"+n.toString(36),"r");
|
var f = require("Storage").open(".gpsrc"+n.toString(36),"r");
|
||||||
var l = f.readLine();
|
var l = f.readLine();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: New App!
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
var s = require("Storage");
|
||||||
|
var apps = s.list(/\.info$/).map(app=>{var a=s.readJSON(app,1);return a&&{name:a.name,type:a.type,icon:a.icon,sortorder:a.sortorder,src:a.src};}).filter(app=>app && (app.type=="app" || app.type=="clock" || !app.type));
|
||||||
|
apps.sort((a,b)=>{
|
||||||
|
var n=(0|a.sortorder)-(0|b.sortorder);
|
||||||
|
if (n) return n; // do sortorder first
|
||||||
|
if (a.name<b.name) return -1;
|
||||||
|
if (a.name>b.name) return 1;
|
||||||
|
return 0;
|
||||||
|
});
|
||||||
|
var APPH = 64;
|
||||||
|
var menuScroll = 0;
|
||||||
|
var menuShowing = false;
|
||||||
|
var w = g.getWidth();
|
||||||
|
var h = g.getHeight();
|
||||||
|
var n = Math.ceil((h-24)/APPH);
|
||||||
|
var menuScrollMax = APPH*apps.length - (h-24);
|
||||||
|
|
||||||
|
apps.forEach(app=>{
|
||||||
|
if (app.icon)
|
||||||
|
app.icon = s.read(app.icon); // should just be a link to a memory area
|
||||||
|
});
|
||||||
|
|
||||||
|
function drawApp(i) {
|
||||||
|
var y = 24+i*APPH-menuScroll;
|
||||||
|
var app = apps[i];
|
||||||
|
if (!app || y<-APPH || y>=g.getHeight()) return;
|
||||||
|
g.setFont("6x8",2).setFontAlign(-1,0).drawString(app.name,64,y+32);
|
||||||
|
if (app.icon) try {g.drawImage(app.icon,8,y+8);} catch(e){}
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawMenu() {
|
||||||
|
g.reset().clearRect(0,24,w-1,h-1);
|
||||||
|
g.setClipRect(0,24,g.getWidth()-1,g.getHeight()-1);
|
||||||
|
for (var i=0;i<n;i++) drawApp(i);
|
||||||
|
g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1);
|
||||||
|
}
|
||||||
|
g.clear();
|
||||||
|
drawMenu();
|
||||||
|
Bangle.on('drag',e=>{
|
||||||
|
var dy = e.dy;
|
||||||
|
if (menuScroll - dy < 0)
|
||||||
|
dy = menuScroll;
|
||||||
|
if (menuScroll - dy > menuScrollMax)
|
||||||
|
dy = menuScroll - menuScrollMax;
|
||||||
|
if (!dy) return;
|
||||||
|
g.reset().setClipRect(0,24,g.getWidth()-1,g.getHeight()-1);
|
||||||
|
g.scroll(0,dy);
|
||||||
|
menuScroll -= dy;
|
||||||
|
if (e.dy < 0) drawApp(Math.floor((menuScroll+24)/APPH)+n-1);
|
||||||
|
else drawApp(Math.floor((menuScroll+24)/APPH));
|
||||||
|
g.setClipRect(0,0,g.getWidth()-1,g.getHeight()-1);
|
||||||
|
});
|
||||||
|
Bangle.on("touch",(_,e)=>{
|
||||||
|
if (e.y<20) return;
|
||||||
|
var i = Math.floor((e.y+menuScroll-24) / APPH);
|
||||||
|
var app = apps[i];
|
||||||
|
if (!app) return;
|
||||||
|
if (!app.src || require("Storage").read(app.src)===undefined) {
|
||||||
|
E.showMessage("App Source\nNot found");
|
||||||
|
setTimeout(drawMenu, 2000);
|
||||||
|
} else {
|
||||||
|
E.showMessage("Loading...");
|
||||||
|
load(app.src);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Bangle.loadWidgets();
|
||||||
|
Bangle.drawWidgets();
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 899 B |
|
|
@ -29,3 +29,4 @@
|
||||||
0.24: Add Quiet Mode settings
|
0.24: Add Quiet Mode settings
|
||||||
0.25: Move boot.js code into 'boot' app itself
|
0.25: Move boot.js code into 'boot' app itself
|
||||||
0.26: Use Bangle.softOff if available as this keeps the time
|
0.26: Use Bangle.softOff if available as this keeps the time
|
||||||
|
0.27: Add Theme menu
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ function showMainMenu() {
|
||||||
'Select Clock': ()=>showClockMenu(),
|
'Select Clock': ()=>showClockMenu(),
|
||||||
'Set Time': ()=>showSetTimeMenu(),
|
'Set Time': ()=>showSetTimeMenu(),
|
||||||
'LCD': ()=>showLCDMenu(),
|
'LCD': ()=>showLCDMenu(),
|
||||||
|
'Theme': ()=>showThemeMenu(),
|
||||||
'Reset Settings': ()=>showResetMenu(),
|
'Reset Settings': ()=>showResetMenu(),
|
||||||
'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() },
|
'Turn Off': ()=>{ if (Bangle.softOff) Bangle.softOff(); else Bangle.off() },
|
||||||
'< Back': ()=>load()
|
'< Back': ()=>load()
|
||||||
|
|
@ -162,6 +163,41 @@ function showBLEMenu() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showThemeMenu() {
|
||||||
|
function cl(x) { return g.setColor(x).getColor(); }
|
||||||
|
function upd(th) {
|
||||||
|
g.theme = th;
|
||||||
|
settings.theme = th;
|
||||||
|
updateSettings();
|
||||||
|
delete g.reset;
|
||||||
|
g._reset = g.reset;
|
||||||
|
g.reset = function(n) { return g._reset().setColor(th.fg).setBgColor(th.bg); };
|
||||||
|
g.clear = function(n) { if (n) g.reset(); return g.clearRect(0,0,g.getWidth(),g.getHeight()); };
|
||||||
|
g.clear(1);
|
||||||
|
Bangle.drawWidgets();
|
||||||
|
m.draw();
|
||||||
|
}
|
||||||
|
var m = E.showMenu({
|
||||||
|
'Dark BW': ()=>{
|
||||||
|
upd({
|
||||||
|
fg:cl("#fff"), bg:cl("#000"),
|
||||||
|
fg2:cl("#0ff"), bg2:cl("#000"),
|
||||||
|
fgH:cl("#fff"), bgH:cl("#00f"),
|
||||||
|
dark:true
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'Light BW': ()=>{
|
||||||
|
upd({
|
||||||
|
fg:cl("#000"), bg:cl("#fff"),
|
||||||
|
fg2:cl("#00f"), bg2:cl("#0ff"),
|
||||||
|
fgH:cl("#000"), bgH:cl("#00f"),
|
||||||
|
dark:false
|
||||||
|
});
|
||||||
|
},
|
||||||
|
'< Back': ()=>showMainMenu()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function showPasskeyMenu() {
|
function showPasskeyMenu() {
|
||||||
var menu = {
|
var menu = {
|
||||||
"Disable" : () => {
|
"Disable" : () => {
|
||||||
|
|
|
||||||
|
|
@ -3,3 +3,4 @@
|
||||||
0.06: Tweak sizing to allow widgets at top, and add widgets (fix #567)
|
0.06: Tweak sizing to allow widgets at top, and add widgets (fix #567)
|
||||||
0.07: Added leading zero to hours and minutes
|
0.07: Added leading zero to hours and minutes
|
||||||
0.08: Show step count by calling wpedom.getSteps() or activepedom.getSteps()
|
0.08: Show step count by calling wpedom.getSteps() or activepedom.getSteps()
|
||||||
|
0.09: Fix time when minutes<10 and hours>9 (fix #767)
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,13 @@ let currentHRM = "CALC";
|
||||||
function drawTimeDate() {
|
function drawTimeDate() {
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var h = d.getHours(), m = d.getMinutes(), day = d.getDate(), month = d.getMonth(), weekDay = d.getDay();
|
var h = d.getHours(), m = d.getMinutes(), day = d.getDate(), month = d.getMonth(), weekDay = d.getDay();
|
||||||
|
|
||||||
if (h < 10) {
|
if (h < 10) {
|
||||||
h = "0" + h;
|
h = "0" + h;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m < 10) {
|
if (m < 10) {
|
||||||
m = "0" + h;
|
m = "0" + m;
|
||||||
}
|
}
|
||||||
|
|
||||||
var daysOfWeek = ["SUN", "MON", "TUE","WED","THU","FRI","SAT"];
|
var daysOfWeek = ["SUN", "MON", "TUE","WED","THU","FRI","SAT"];
|
||||||
|
|
@ -128,17 +128,10 @@ Bangle.on('lcdPower',on=>{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Show launcher when middle button pressed
|
// Show launcher when button pressed
|
||||||
setWatch(Bangle.showLauncher, BTN2, { repeat: false, edge: "falling" });
|
Bangle.setUI("clockupdown", btn=>{
|
||||||
|
if (btn!=0) return;
|
||||||
Bangle.on('touch', function(button) {
|
//HRM Controller.
|
||||||
if(button == 1 || button == 2){
|
|
||||||
Bangle.showLauncher();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
//HRM Controller.
|
|
||||||
setWatch(function(){
|
|
||||||
if(!HRMstate){
|
if(!HRMstate){
|
||||||
//console.log("Toggled HRM");
|
//console.log("Toggled HRM");
|
||||||
//Turn on.
|
//Turn on.
|
||||||
|
|
@ -155,7 +148,13 @@ setWatch(function(){
|
||||||
currentHRM = [];
|
currentHRM = [];
|
||||||
}
|
}
|
||||||
drawBPM(HRMstate);
|
drawBPM(HRMstate);
|
||||||
}, BTN1, { repeat: true, edge: "falling" });
|
});
|
||||||
|
|
||||||
|
Bangle.on('touch', function(button) {
|
||||||
|
if(button == 1 || button == 2){
|
||||||
|
Bangle.showLauncher();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Bangle.on('HRM', function(hrm) {
|
Bangle.on('HRM', function(hrm) {
|
||||||
if(hrm.confidence > 90){
|
if(hrm.confidence > 90){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue