-
YAY, now it worked.
That is soooo strange!
I have theconst BANGLEJS2 = process.env.HWVERSION == 2;
at the top of my code.
console.log BANGLEJS2;
shows "true".
But the following "if (BANGLEJS2) { " is not entered! No clue what happens there.When I remove the check fpr BJS2, it works.
Another problem is that I get
Uncaught Clock has no widgets, can't fast load
When leaving the launcher despite i do load and show widgets at the end of my code.
-
-
-
-
-
-
https://banglejs.com/apps/?id=widbt_notify does this pretty good. It can be set to buzz when connection is lost. So when I leave the house without the phone, I get notified.
-
-
I now changed it to
Bangle.setUI({ mode : "custom",clock:true, remove : function() { // Called to unload all of the clock app if (typeof PosInterval === "undefined") { console.log("PosInterval is undefined") } else { if (PosInterval) clearInterval(PosInterval); } PosInterval = undefined; if (drawTimeoutSeconds) clearTimeout(drawTimeoutSeconds); drawTimeoutSeconds = undefined; if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = undefined; if (typeof onDrag !== "undefined") Bangle.removeListener('drag',onDrag); if (typeof onLock !== "undefined") Bangle.removeListener('onLock',onLock); }});
Now, the loader shows up, but the Listener seems to be still in place.
-
I attached my current code.
Current log shows:
Uncaught ReferenceError: "onDrag" is not defined at line 1 col 285 ...ngle.removeListener('drag',onDrag);Bangle.removeListener('on... ^ in function "a" called from line 2 col 168 ...e;delete Bangle.uiRemove;a()}g.reset();if(c){if("updown"==c)... ^ in function called from line 1 col 31 Bangle.uiRemove?(Bangle.setUI(),(__FILE__=a)||(a=".bootcde")... ^ at line 1 col 115 ..."Storage").read(a))):load(a) ^ in function called from line 1 col 408 ...))}c?Bangle.load(b.launcher):eval('E.showMessage("No Launche... ^ at line 1 col 525 ...at:false,edge:"falling"});'); ^ in function called from system
How do I resolve this?
However, development is very difficult for me as I do not understand certain things. E.g. when I want to check the interaction between the watchface and the loader, the easiest would be to just upload my watchface to the storage. But when I do that via IDE, I get strange errors from the watchface that I don't get when it is uploaded to RAM:
Uncaught Error: Module Font5x9Numeric7Seg not found at line 15 col 29 in hworldclock.app.js require("Font5x9Numeric7Seg").add(Graphics); ^
-
-
PS: I will do the revert. Never mind. Sorry for any inconvenience.
https://github.com/espruino/BangleApps/pull/2374 -
Revert this PR? https://github.com/espruino/BangleApps/pull/2369
Yes, please!
-
@Gordon could you do me a favor and revert this whole PR?
Also I'm really wondering why the watchface is still loaded when the launcher is shown. How do I kill my
Bangle.on("drag", e => {
when user presses the button for the launcer?Not that familiar with git and I'm afraid I would break something. I now discovered the problem that I cannot use the launcher anymore. Did not notice that before. Will work on this eventually but for now I got no time :(
@Serj will hopefully consider the 90° then :) -
Yes, I guess I could. I'll let this as is for now. Maybe I'll add a toggle for BJS1 later.
https://github.com/espruino/BangleApps/pull/2369The screen won't automatically swap back when the next app loads (since it's set up so left-handed users can permanently keep their watch in that state), so you'll need to implement a handler for the Bangle.on('kill', ...) event to call g.setRotation(0) to put it back.
Actually now that I tried it out on the watch I find it better to not reset this when exiting. It's a neat feature to change global orientation quickly :)
-
-
-
Just out of curiosity, is there a way to rotate the screen 180° and keep it rotated until the watchface is unloaded (e.g. when the loader shall show up)?
I'm tempted to add a feature to my watchface that if it's unlocked you would swipe up to roate the whole screen to show the time to another person and swipe it again to have the normal mode.
-
Yes, exactly, it's usually quite easy. I guess maybe it would be possible to use the Github API to dig out who the authors were in an easy way? Or maybe there's a page I could just link to as I know GitHub lists icons for the top authors at the top of the directory list usually.
I know that GIT has this feature. But to see it in the app loader would be just much more convenient. And if I do a quick patch I don't want to appear as the maintainer.
I'd be ok with an optional field in the json. That way a maintainer also can intentionally set an app as "free to take over" for any other user because he doesn't want to maintain it anymore.
The patch approach is very interesting, but I also doubt the user would understand.I just want to encourage developers to get in contact with each other before they just make a new fork to implement a small feature that could have been an option in the settings :)
Making a fork is very easy - implementing a feature to other developers apps is more a communication thing some people might just want to skip. -
My intention was more the developer to developer perspective. Say, when I want to add a feature to an app, I maybe would like to ask the maintainer if adding it would fit in his global concept of the app. Otherwise I would just add a fork of the app and take control. That might also reduce the amount of forks. Many forks may confuse the user. E.g. we have multiple BT status widgets and in future multiple message apps maybe...
-
-
Thanks for those suggestions.
Implemented most of them hereThough, I am still not sure with the variables as I use some of them globally, so I use var instead of let. What's the best practice on that?
(Sorry, I don't want to hijack this conversation for noob programming questions) -
You mean for hworldclock itself after the merge?
yes.
Actually works only once, it seems some more cleanup is needed
Bummer, I hoped it was easier. Could you guys help me to tidy up the watchface somehow?
It might look as I'm a programmer, but most I do is copy&paste (like a senior programmer - but without the background knowledge :) )
I actually also tried to check for
and it didn't work.
Got it with the settings. It seemed to be necessary to assign the default clock again in the settings. Thank you all for those many hints!