Skip to content

Commit ea22929

Browse files
committed
docs: update to reflect current setUI implementations
1 parent c72410f commit ea22929

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

libs/banglejs/jswrap_bangle.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6342,18 +6342,19 @@ Bangle.setUI("updown", function (dir) {
63426342
```
63436343
63446344
The first argument can also be an object, in which case more options can be
6345-
specified with `mode:"custom"`:
6345+
specified`:
63466346
63476347
```
63486348
Bangle.setUI({
6349-
mode : "custom",
6349+
mode : "custom", // can also be set to one of the other modes presented above in order to extend them.
63506350
back : function() {}, // optional - add a 'back' icon in top-left widget area and call this function when it is pressed , also call it when the hardware button is clicked (does not override btn if defined)
63516351
remove : function() {}, // optional - add a handler for when the UI should be removed (eg stop any intervals/timers here)
63526352
redraw : function() {}, // optional - add a handler to redraw the UI. Not needed but it can allow widgets/etc to provide other functionality that requires the screen to be redrawn
6353-
touch : function(n,e) {}, // optional - (mode:custom only) handler for 'touch' events
6354-
swipe : function(dir) {}, // optional - (mode:custom only) handler for 'swipe' events
6355-
drag : function(e) {}, // optional - (mode:custom only) handler for 'drag' events (Bangle.js 2 only)
6356-
btn : function(n) {}, // optional - (mode:custom only) handler for 'button' events (n==1 on Bangle.js 2, n==1/2/3 depending on button for Bangle.js 1)
6353+
touch : function(n,e) {}, // optional - handler for 'touch' events
6354+
swipe : function(dir) {}, // optional - handler for 'swipe' events
6355+
drag : function(e) {}, // optional - (mode:updown/leftright incompatible) handler for 'drag' events (Bangle.js 2 only)
6356+
btn : function(n) {}, // optional - handler for 'button' events (n==1 on Bangle.js 2, n==1/2/3 depending on button for Bangle.js 1)
6357+
btnRelease : function(n) {}, // optional - same as btn but react on release instead of press down.
63576358
clock : 0 // optional - if set the behavior of 'clock' mode is added (does not override btn if defined)
63586359
});
63596360
```

0 commit comments

Comments
 (0)