You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/sched/README.md
+1-90Lines changed: 1 addition & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,96 +13,7 @@ The `Alarms & Timers` app allows you to add/modify any running alarms and timers
13
13
14
14
### Snooze Menu
15
15
16
-
With sched version 0.35 or later, when an alarm or timer is triggered, and you have the latest cutting-edge firmware (will be 2v28 when released), you can long press on the snooze button that pops up to go to a snooze menu, for finer control over snooze amounts. If you do not have the latest firmware or use the code below, you will not notice any changes.
17
-
18
-
If you want the functionality, but don't want to use cutting-edge firmware, you can upload this code to the bangle from the Web IDE instead, as `2v28_sim.boot.js`:
19
-
20
-
```
21
-
E.showPrompt=(function(message,options) {
22
-
if (!options) options={};
23
-
if (!options.buttons)
24
-
options.buttons = {"Yes":true,"No":false};
25
-
var btns = Object.keys(options.buttons);
26
-
if (btns.length>6) throw new Error(">6 buttons");
27
-
var btnPos;
28
-
function draw(highlightedButton) {
29
-
g.reset().setFontAlign(0,0);
30
-
var R = Bangle.appRect, Y = R.y, W = R.w;
31
-
var title = g.findFont(options.title||"", {w:W-2,wrap:1,max:24});
var ui = {mode:"custom", remove: options.remove, redraw: draw, back:options.back, touch:(_,e)=>{
80
-
btnPos.forEach((b,i)=>{
81
-
if (e.x >= b.x1 && e.x <= b.x2 &&
82
-
e.y >= b.y1 && e.y <= b.y2 && !e.hit) {
83
-
e.hit = true; // ensure we don't call twice if the buttons overlap
84
-
draw(i); // highlighted button
85
-
g.flip(); // write to screen
86
-
E.showPrompt(); // remove
87
-
if (e.type===2 /*long press*/ && options.buttonsLong && btns[i] in options.buttonsLong)
88
-
resolve(options.buttonsLong[btns[i]]);
89
-
else
90
-
resolve(options.buttons[btns[i]]);
91
-
}
92
-
});
93
-
}};
94
-
if (btns.length==1 && !options.back) ui.btn = () => {
95
-
draw(0); // highlighted button
96
-
g.flip(); // write to screen
97
-
E.showPrompt(); // remove
98
-
resolve(options.buttons[btns[0]]);
99
-
};
100
-
Bangle.setUI(ui);
101
-
});
102
-
})
103
-
104
-
```
105
-
That mimics the change in `E.showPrompt` needed to make the function work.
16
+
With sched version 0.35 or later, when an alarm or timer is triggered, and you have the latest cutting-edge firmware (or 2v28 when released), you can long press on the snooze button that pops up to go to a snooze menu, for finer control over snooze amounts. If you do not have the latest firmware, you will not notice any changes.
0 commit comments