1
0
Fork 0

Merge pull request #2243 from thyttan/torch

[Torch] Move interactions inside setUI
master
Gordon Williams 2022-11-09 08:46:17 +00:00 committed by GitHub
commit a20f1b8fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -4,3 +4,4 @@
0.04: Add Support For Bangle.js 2
0.05: Default full Brightness
0.06: Press upper left corner to exit on Bangle.js 2
0.07: Code tweaks

View File

@ -13,12 +13,12 @@ Bangle.setLCDTimeout(0);
g.reset();
g.setColor(settings.bg);
g.fillRect(0,0,g.getWidth(),g.getHeight());
// Any button turns off
setWatch(()=>load(), BTN1);
if (global.BTN2) setWatch(()=>load(), BTN2);
if (global.BTN3) setWatch(()=>load(), BTN3);
// Pressing upper left corner turns off (where red back button would be)
Bangle.setUI({
mode : 'custom',
back : load
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
if (process.env.HWVERSION==1 && (n==1 || n==2 || n==3)) {
load();
}
}
});

View File

@ -2,7 +2,7 @@
"id": "torch",
"name": "Torch",
"shortName": "Torch",
"version": "0.06",
"version": "0.07",
"description": "Turns screen white to help you see in the dark. Select from the launcher or press BTN1,BTN3,BTN1,BTN3 quickly to start when in any app that shows widgets on Bangle.js 1. You can also set the color through the app's setting menu.",
"icon": "app.png",
"tags": "tool,torch",