From b4b3775b23a90003011bbdcdf71e0572599bda0d Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Sun, 6 Nov 2022 00:48:38 +0100 Subject: [PATCH 1/2] exit by pressing upper left corner --- apps/torch/ChangeLog | 1 + apps/torch/README.md | 2 ++ apps/torch/app.js | 6 ++++++ apps/torch/metadata.json | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 apps/torch/README.md diff --git a/apps/torch/ChangeLog b/apps/torch/ChangeLog index fd904b6e8..22b1c179a 100644 --- a/apps/torch/ChangeLog +++ b/apps/torch/ChangeLog @@ -3,3 +3,4 @@ 0.03: Add Color Changing Settings 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 diff --git a/apps/torch/README.md b/apps/torch/README.md new file mode 100644 index 000000000..e06861071 --- /dev/null +++ b/apps/torch/README.md @@ -0,0 +1,2 @@ +On Bangle.js 2, pressing the upper left corner where the red back button would be exits the app if the screen is unlocked. + diff --git a/apps/torch/app.js b/apps/torch/app.js index 2af35fdb6..78eda214b 100644 --- a/apps/torch/app.js +++ b/apps/torch/app.js @@ -13,8 +13,14 @@ 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); +// Press upper left corner to exit (where red back button would be) +Bangle.setUI({ + mode : 'custom', + back : load +}); diff --git a/apps/torch/metadata.json b/apps/torch/metadata.json index af85370ac..580ae4e8a 100644 --- a/apps/torch/metadata.json +++ b/apps/torch/metadata.json @@ -2,7 +2,7 @@ "id": "torch", "name": "Torch", "shortName": "Torch", - "version": "0.05", + "version": "0.06", "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", From 218cfd9c08318a799a8922e1d1d3838eaefa4b0d Mon Sep 17 00:00:00 2001 From: thyttan <97237430+thyttan@users.noreply.github.com> Date: Sun, 6 Nov 2022 01:01:33 +0100 Subject: [PATCH 2/2] Update app.js --- apps/torch/app.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/torch/app.js b/apps/torch/app.js index 78eda214b..418463144 100644 --- a/apps/torch/app.js +++ b/apps/torch/app.js @@ -13,13 +13,11 @@ 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); - -// Press upper left corner to exit (where red back button would be) +// Pressing upper left corner turns off (where red back button would be) Bangle.setUI({ mode : 'custom', back : load