commit
9eded4cb3c
|
|
@ -1 +1,2 @@
|
||||||
0.01: New app!
|
0.01: New app!
|
||||||
|
0.02: Add prompt before shutdown
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,23 @@
|
||||||
g.clear();
|
g.clear();
|
||||||
|
|
||||||
g.setFont("6x8",2).setFontAlign(0,0);
|
E.showPrompt('Are you sure?', {
|
||||||
|
title: 'Power off',
|
||||||
|
buttons: { Yes: true, No: false },
|
||||||
|
}).then((confirm) => {
|
||||||
|
if (!confirm) {
|
||||||
|
setTimeout(load, 100);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
g.setFont("6x8",2).setFontAlign(0,0);
|
||||||
var x = g.getWidth()/2;
|
var x = g.getWidth()/2;
|
||||||
var y = g.getHeight()/2 + 10;
|
var y = g.getHeight()/2 + 10;
|
||||||
g.drawString("Powering off...", x, y);
|
g.drawString("Powering off...", x, y);
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
if (Bangle.softOff) Bangle.softOff(); else Bangle.off();
|
if (Bangle.softOff) Bangle.softOff(); else Bangle.off();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
Bangle.loadWidgets();
|
Bangle.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ "id": "poweroff",
|
{ "id": "poweroff",
|
||||||
"name": "Poweroff",
|
"name": "Poweroff",
|
||||||
"shortName":"Poweroff",
|
"shortName":"Poweroff",
|
||||||
"version":"0.01",
|
"version":"0.02",
|
||||||
"description": "Simple app to power off your Bangle.js",
|
"description": "Simple app to power off your Bangle.js",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"tags": "tool, poweroff, shutdown",
|
"tags": "tool, poweroff, shutdown",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue