-
• #2
Hi - is your Bangle.js firmware and JS apps all up to date?
The back button is handled in the Bangle.js firmware itself, in
Bangle.setUI
: https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_setUI_F18.js#L85-L101The thing is the back button goes into the Widget bar, so if your app doesn't have widgets (or isn't expecting them) then that can cause a problem.
... but the pictures you show are using
E.showScroller
andE.showMenu
and both of those should really work fine.If you go to the emulator https://www.espruino.com/ide/ then top-left, Emulator, Bangle.js 1, then type
Bangle.factoryReset()
into the left-hand side of the IDE you can see the menus and the back button work great - so I wonder if the issue is that something is out of date -
• #3
This problem began recently when I updated (firmware 2v16, all apps are updated). One issue might be that I don't have any widgets installed (right now I'm using a custom clock I made that displays info on its own).
-
• #4
Reminds me a little of this issue regarding E.showMenu.
-
• #5
Looks like that's it... This breaks on Bangle.js 1:
var mainmenu = { "" : { title : "-- Main Menu --", back : function() {} }, "Hello" : function() { } }; E.showMenu(mainmenu);
And this breaks on Bangle.js 1 and 2:
E.showScroller({ h : 40, c : 8, draw : (idx, r) => { g.setBgColor((idx&1)?"#666":"#999").clearRect(r.x,r.y,r.x+r.w-1,r.y+r.h-1); g.setFont("6x8:2").drawString("Item Number\n"+idx,r.x+10,r.y+4); }, select : (idx) => console.log("You selected ", idx), back : function() {} });
It's from this PR https://github.com/espruino/Espruino/pull/2286 so it looks like while it was tested, it wasn't tested on Bangle.js 1, and unfortunately showScroller didn't get tested on either of them (although it should have been on Bangle.js 2 as part of showMenu).
I'll try and get a fix in now
-
• #6
Ok, all fixed I hope! You'll need to download a 'cutting edge' build to fix it though
-
• #7
Hm, so the problem was essentially the order of stuff accessing
appRect
and callingsetUI
? Would #2286 actually have influenced that? -
• #8
This one? https://github.com/espruino/BangleApps/issues/2286
the problem was essentially the order of stuff accessing appRect and calling setUI
Yes - it looked at the appRect before setUI (when there might be no widgets)
-
• #9
No, I meant the espruino pull you linked since that does not change the access order. I would suspect that it was broken even before that for the no widgets loaded situation.
-
• #10
Sorry - I was being dense there!
I would suspect that it was broken even before that for the no widgets loaded situation.
I don't think so, because the issue is
setUI({back})
adds a widget even if there were no widgets loaded. But before that PR,showScroller/showMenu/etc
couldn't ever callsetUI
withback
so it couldn't happen
I recently updated my Bangle to the latest firmware and apps. However the back button seems to be clipping some stuff off (I attached some images). Has anyone ran into this before? Where even is the source code for the back button?
2 Attachments