-
-
-
I updated the
renderTopBar()
method to draw the "widgets" only if its value has been changed but there's something wrong. Last night battery drop from 70% to 30% :-(let prevLocked = undefined; let prevConnected = undefined; function renderTopBar() { const itemW = 10; const itemH = 2; let locked = Bangle.isLocked(); if (locked != prevLocked) { const lockColor = locked ? g.theme.fg : g.theme.bg; g.setColor(lockColor).fillRect(0, 0, itemW, itemH).setColor(g.theme.fg); prevLocked = locked; } let connected = NRF.getSecurityStatus().connected; if (connected != prevConnected) { const bluetoothColor = connected ? (g.theme.dark ? "#0ff" : "#00f") : (g.theme.dark ? "#666" : "#999"); g.setColor(bluetoothColor).fillRect(itemW + 1, 0, 1 + itemW * 2, itemH).setColor(g.theme.fg); prevConnected = connected; } } Bangle.on("lock", b => { renderTopBar(); }); NRF.on("connect", () => { renderTopBar(); }); NRF.on("disconnect", () => { renderTopBar(); });
Am I missing anything else?
-
Not sure if ClockFace and Layout libs do that automatically because I'm currently not using them, but are you drawing the screen every minute or so?
Yes, I configured Clockface with a "precision" of 60 seconds.
If you draw the screen every cycle, it may be the reason.
Damn, I didn't notice I forgot to redraw my topbar only if something changed .-. I'll fix asap!
Thanks!
-
Hello!
Lately I have little free time but I am trying to work on my own clock using ClockFace and Layout libs.
My goals are:
- fullscreen (no widgets)
- only show date + time + steps
- custom "widgets" in the top bar
- battery status in the bottom bar
After I added the top bar I noticed a HUGE battery drain (30-40% per day!) but I don't undestand why.
What's wrong with my code?The code is in my fork: https://github.com/alessandrococco/BangleApps/blob/poc-my-clock/apps/patclock/app.js
Thank you! :-)
- fullscreen (no widgets)
-
-
I recently bought a cheap nylon strap https://www.amazon.it/dp/B09Q62CLXV
It's more comfortable than the silicone one.
-
I don't think we should make the clock do this
I just realized that a clockface hourstrike wouldn't work if the clock is not active 😅 Yes, bootcode should be a better place for it.
How about linking it to Quiet Mode?
That's what I was thinking! In a local branch I'm trying to "merge" the Quiet Mode Schedule into the default quiet mode menu - imho there's no need to have a "quiet mode" menu and a different app to manage it.
We can make qmsched emit an event when switching, and have ClockFace force a redraw when that happens, so the clock can adjust it's precision then.
I like it!
-
You could use the new ClockFace library and avoid low-level boilerplate :)
-
It's a typo - the correct name of the function is meridian ;-)
I just opened a PR to fix the tutorial.
-
Hello!
I started to upgrade existing clocks to ClockFace lib. With more ClockFace-based clocks I think we could aim to a better unified "standard" features (so we can remove old and bugged apps/widgets and avoid to duplicate code (less code = less bugs!))
I was think about some features I'd like to see in the library:
- configurable buzz at hour/half hour (similar to [https://github.com/espruino/BangleApps/tree/master/apps/hourstrike] - I tried this app for a while but I noticed it is bugged (sometimes it does not work or it works twice) and I wasn't able to fix :( With ClockFace_menu we can configure start/end hours, the type of buzz etc.)
- a configurable night/sleep mode - eg NotAnalog Clock stops updating the clock after midnight (but it wakes itself if user unlock the watch) - This could be an alternative to turning off the watch every night.
What do you think?
Tag for @rigrig as they're the creator of ClockFace :-)
- configurable buzz at hour/half hour (similar to [https://github.com/espruino/BangleApps/tree/master/apps/hourstrike] - I tried this app for a while but I noticed it is bugged (sometimes it does not work or it works twice) and I wasn't able to fix :( With ClockFace_menu we can configure start/end hours, the type of buzz etc.)
-
my seiko watch face which I assume the watch face shouldn’t be draining too much battery as it’s using drawImages.
If the clock face updates every second then it'll drain a lot of battery. Do you turn off the watch at night?
Many clock faces update seconds only when screen is unlocked to preserve battery.
-
-
-
-
Agree, your solution is much better.
What do you think about a variable "precision"? Eg 60 seconds when Bangle is locked and 1 second when unlocked? (customizable)
My use case is that on my custom clock (using Clock Face + Layout) I want to show the next timer. I update the residual time every minute (eg. ~10m, ~5m, ~2m etc.) but when timer is < 1m I'd want to update every second.
Is a variable precision something we could add to the module? Maybe the return value of draw()/update() will be set as next precision? If undefined the default precision will be used.
What do you think?
-
-
Also, if you don't want widgets in all your apps why not just uninstall the widgets? Then it'll be much faster as well.
I just noticed I forgot to add some details. I was thinking about the hideable widgets bar. I'd like to be able to hide the widgets from all the apps (clock face included) so the apps could use 100% of the screen but I'd like to temporarily display the widgets with a swipe in the clock face (like android control center/notifications)
But I do wonder: Is this something people really want?
I can only speak for myself but I think it is a shared thought: users want a better user experience. The Bangle is a wonderful device but some things feel unpolished and barebones. A trivial example: labels capitalization. Some labels are all lowercase, some Full Camel Case, some Another case variant etc.
IMHO the Bangle lacks some consistency here and there and I'd like to help to improve it (I love the bangle, this is also the first open source project I actively participate!) (this is one of the main reasons I rewrote the alarms app)
Anyway kudos to Gordon for everything!
-
I think for now, a loadWidgets in ClockFace is the best way to go if you really want to have it configurable, but it should be per-clock.
Ok!
@rigrig - do you mind if I reopen my PR?
I can totally imagine a case where someone has more than one clock face installed, and has one for daytime and one for night. In that case it'd make a lot of sense that the night-time one was configured without widgets, and the daytime one had them. But if it's a global setting then that's not really possible.
Yup, it makes sense.
Also, someone will definitely toggle the setting and forget, and then complain that widgets have all disappeared :)
haha, true :-D
-
A useful feature would be the loadWidget yes/no.
In a PR you said
But more importantly, I don't think we want clocks to disable the widgets, I think it should be a global setting. That way clocks can use Bangle.appRect to work either way, and users can decide if they want widgets independently from which clock they install.
but we have many Clocks that allow to show/hide the widgets (mosaic, lcars, time traveler clock, some analogue, ecc).
A global option would be great, like
- Settings → Widgets
- Load & Show [X]
- Load Only []
- Don't Load
- Load & Show [X]
An app should read this option and regulate itself (better: should loadWidgets()/drawWidgets() handle the option? Pro: all apps will work automatically without further updates)
Meanwhile a
loadWidgets
option in ClockFace should be a good compromise - What do you say? - Settings → Widgets
-
-
I need a bit of help on the Gadgetbridge side of things.
Which repository should be used? I didn't find the Gadgetbridge one in espruino.
-
What about emitting an "alarm" event? An app could add an handler for it like
Bangle.on("alarm", (important) => { // save state? var ret = ? // ret = 1: exit app and show the alarm // ret = 2: remain in the app and show a blinking icon in widget bar // ret = 0: ignore the alarm return ret; }); Bangle.on("afterAlarm", () => restore..)
Could be an idea?
-
Yes, Active Pedometer is only available for Bangle 1.
For Bangle 2 there are other widgets: https://banglejs.com/apps/?q=pedometer
Thank you :)