1
0
Fork 0
BangleApps/apps/torch/app.js

26 lines
680 B
JavaScript
Raw Normal View History

2022-02-02 23:34:12 +00:00
const SETTINGS_FILE = "torch.json";
2022-02-03 00:01:40 +00:00
let settings;
2022-02-02 23:34:12 +00:00
function loadSettings() {
settings = require("Storage").readJSON(SETTINGS_FILE,1)|| {'bg': '#FFFFFF', 'color': 'White'};
}
2022-02-03 00:07:08 +00:00
loadSettings();
Bangle.setLCDBrightness(1);
2020-03-03 15:59:00 +00:00
Bangle.setLCDPower(1);
Bangle.setLCDTimeout(0);
g.reset();
2022-11-09 10:22:19 +00:00
g.setTheme({bg:settings.bg,fg:"#000"})
2022-02-02 23:34:12 +00:00
g.setColor(settings.bg);
2020-03-03 15:59:00 +00:00
g.fillRect(0,0,g.getWidth(),g.getHeight());
2022-11-05 23:48:38 +00:00
Bangle.setUI({
mode : 'custom',
2022-11-07 17:37:49 +00:00
back : load, // B2: Clicking the hardware button or pressing upper left corner turns off (where red back button would be)
btn : (n)=>{ // B1: Any button turns off
2022-11-07 19:36:54 +00:00
if (process.env.HWVERSION==1 && (n==1 || n==2 || n==3)) {
load();
2022-11-07 17:37:49 +00:00
}
2022-11-07 20:15:01 +00:00
}
2022-11-05 23:48:38 +00:00
});