-
-
Hello,
I recently upgraded my firmware to the cutting edge build
espruino_2v24.125_banglejs2.zip
to have the new Alarm update (long press to toggle alarm) and it introduced two bugs in my Elapsed Time app.The first one: it is not possible anymore to add or substract two dates, as it returns
NaN
. The comparison operators also don't work anymore. The fix is easy : just add.getTime()
.Example from the console:
>now.getTime() < target.getTime() =true >now < target =false >now - target =NaN
The second one is more tricky. It seems like when the
touch
event calls a scroller, like this:Bangle.on('touch', function (zone, e) { if (!inMenu && e.y > 24) { if (drawTimeout) clearTimeout(drawTimeout); showMainMenu(); inMenu = true; } });
Then the scroller is displayed, and immediately the menu row located where the touch event was is called. So it immediately goes into whatever menu item that was "under" the touch.
Not sure if I make much sense explaining it but here attached is a video that shows it: I tap the screen and the menu is displayed, and immediately the Date item is called because that's where my finger was.Do you have any ideas on how to fix this?
Thanks
-
-
-
It looks like something went wrong in the
generate.js
script for my two PNGs because when I dorequire("Storage").read("messageicons.img", 20*76, 76)
I get\x18\x18\x81
and then a bunch of\0\0\0
. Basically there is no data for the two icons I added.Maybe something is wrong with the PNG files, but I didn't get any warning/error when running the script.
-
-
Thanks Gordon!
I tried adding the new icons, ran
generate.js
, and tried updating themessageicons
app from my personal app loader, but the resulting icon is completely white, both for Gmail and Messages.I'm not sure about what I did wrong.
Here is my commit: https://github.com/espruino/BangleApps/compare/master...paul-arg:BangleApps:messageicons
Here is the app loader: https://paul-arg.github.io/BangleApps/Any help would be appreciated
-
-
Thanks for the feedback!
Yes, that's what I did: https://github.com/espruino/BangleApps/pull/3455
-
Thanks, that's indeed more elegant.
I think I'm all set now. I also created a triple int picker because why not. (see attachments) I don't think I can make more than 3 columns though because the screen is not that big.
The result looks pretty similar to the "stock" picker. I also added the possibility to add custom separators like
:
for times and/
for dates. (who knows, maybe soccer players will use-
to input a score for example)In code it can be used quite easily with a syntax that is very similar to the stock one:
function showMainMenu() { E.showMenu({ 'Date': function () { showTripleIntPicker({ back: showMainMenu, title: "Date", //separator_1: "/", //separator_2: "/", value_1: day, min_1: 1, max_1: 31, step_1: 1, wrap_1: true, value_2: month, min_2: 1, max_2: 12, step_2: 1, wrap_2: true, value_3: year, min_3: 2000, max_3: 2050, step_3: 1, wrap_3: false, format_1: function (v_1) { return (pad2(v_1)); }, format_2: function (v_2) { return (pad2(v_2)); }, onchange: function (v_1, v_2, v_3) { day = v_1; month = v_2; year = v_3; } }); } }); } showMainMenu();
Next order of business is to whip a MR :)
-
Alright, I'm almost done, check the attached video.
My only remaining question is: how can I go back to the original menu when I validate my input or click the back button? Currently I pass the original menu in a
goBackTo
objectvar hours = 10; var minutes = 32; var menu = { 'Time': function () {showDoubleIntPicker("Title",{ goBackTo: menu, value_1: hours, step_1: 1, min_1: 0, max_1: 23, wrap_1: true, value_2: minutes, step_2: 1, min_2: 0, max_2: 59, wrap_2: true, format: function (v_1, v_2) {}, onchange: function (v_1, v_2) {hours = v_1; minutes = v_2;} });} };
and then call
E.showMenu(goBackTo);
when I need to go back.But I imagine there are more elegant ways to do it?
-
Thanks for the suggestion @Gordon !
I have a question with the code format.
If I prototype my custom picker like this :
function showTimePicker(options){ console.log(options); }
Later do I need to call it like this in my menu:
E.showMenu({ 'Time': showTimePicker({ foo : "bar", spam : "eggs" }) });
or like this:
E.showMenu({ 'Time': function () {showTimePicker({ foo : "bar", spam : "eggs" });} });
?
-
Hello,
I was thinking that it would be neat to have a menu that allows to select two numbers at the same time. The most typical usecase would be to select a time, with the hours and minutes next to each other. It could be a small but nice QOL update.
I tried and made a quick mockup (see attachment), and the result looks nice, because the watch screen has enough real estate for that.
In the code, it could be easy to set up as well. An example could be:
"Time" : { value : double_number, min_1:0,max_1:23,step_1:1, min_2:0,max_2:59,step_2:1, onchange_1 : v_1 => { number_1=v_1; } format_1: function (v_1) { return something(v_1); } onchange_2 : v_2 => { number_2=v_2; } format_2: function (v_2) { return something(v_2); } },
My understanding is that in order to achieve that I need to tweak the
Espruino/libs/js/banglejs /E_showMenu_Q3.js
file, and then build a custom firmware and upload it to the watch. Is that correct?Thank you for your insights
-
-
Hello,
Is there a way to set the default Clock (Settings > System > Clock) from outside the settings? Typically, from a "Set as default" menu in the clock itself.
My understanding is that I just need to update
clock
andclockHasWidgets
thesettings.json
file, but is there something else? I noticed that when changing the clock from the settings, the watch showsUpdating boot0...
Thank you for your insights
-
-
I understand now, indeed the default size for "text to image" is 18. The problem is that this does not adapt to the size of the other "non image" characters. (See screenshots with example sizes 18 and 36)
So my best bet is to keep it at 18 so that it matches the smallest possible font size and live with it.
However yes we need to split the text around the "image" characters. I just realized that the behavior also applies to text that is before and emoji or € sign.
-
-
Hello,
I noticed two problems with the Gadgetbridge "text to image" feature.
1/ Text immediately followed by an emoji will be displayed in white, and is thus invisible. (See screenshot, the test was
test🙂
2/ The euro symbol € seems to be twice smaller than the other characters, and when there are digits attached to it, the digits reduce in size as well. (See screenshots, the tests were
15,50€
and50 €
.Is this more a Gadgetbridge issue than a Bangle JS issue?
Thanks,
-
-
-
Hello,
I developed a clock face that uses the
VGA8
font.
At the beginning I call:
require("FontVGA8").add(Graphics);
.
I tried implementing fast loading so in theremove
handler I call:
delete Graphics.prototype.setFontVGA8;
The problem is that I also have a widget that uses the
VGA8
font. Now, even though the widget callsrequire("FontVGA8").add(Graphics);
in the beginning of its own code as well, I get the errorUnknown font VGA8.
Was I supposed to call
delete Graphics.prototype.setFontVGA8;
? -
-
Hello there,
A while ago I came across the Omega X33 Skywalker watch. This watch has been certified by the European Space Agency to be worn by astronauts in space. It has a very interesting feature called "Phase Elapsed Time". Basically you can set any target date and time in the past or in the future and the watch will tell you the remaining/elapsed time until/since the target.
Small problem, the watch costs ~6500€.
Since I cannot afford to pay 6 months of rent for a watch, I decided to recreate the feature in an app for the Bangle JS.The app is here if you want to try it: https://banglejs.com/apps/?id=elapsed_t
I personally use it to quickly know in how much time is a train or a plane I don't want to miss. You can also use it to calculate your age, days until a birthday or an important date, etc...
I also created a clock face with a Vaporwave theme, that you can try here: https://banglejs.com/apps/?id=vpw_clock
I'm very grateful for this watch, especially for how easy it is to code and upload new apps to the watch. I sometimes edit code right on my phone, which of course isn't practical but at least has the merit to be possible! Kudos for that
Cheers
Thank you for the fast fix @Gordon!
I upgraded to 2v24.137 and both problems are now fixed!