Skip to content

Conversation

@bangledev
Copy link

This is my first contribution on Github. I appreciate any feedback. The watch face shows oblique strategies for getting unstuck in the creative process. Per tap or time change the text changes to a random different one. The time is rounded up to 5 Minutes. It also shows, if the user is moving or not with the acc.

Bangle.removeListener('accel', accelHandler);
Bangle.removeListener('touch', onTap);
Bangle.removeListener('tap', onTap);
Bangle.removeAllListeners('lcdPower');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll break widgets or boot code which listen to 'lcdPower', let's get hold of the function and remove just that

Copy link
Author

@bangledev bangledev Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback and patience! I removed the removeListeners now. Or did you mean i should only remove thelcdPower line?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah neither in fact :) I was thinking we do this:

-Bangle.on('lcdPower', on=>{
+const lcdListener = on => {
   if (on){ Bangle.on('accel', accelHandler); draw(); }
   else Bangle.removeListener('accel', accelHandler);
-});
+};
+Bangle.on('lcdPower', lcdListener);

and:

     Bangle.removeListener('accel', accelHandler);
     Bangle.removeListener('touch', onTap);
     Bangle.removeListener('tap', onTap);
-    Bangle.removeAllListeners('lcdPower');
+    Bangle.removeListener('lcdPower', lcdListener);


// info row: Day N | Wed Oct. 22 | W43
function makeInfoText(now, width){
const doy=dayOfYear(now);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also use the Locale module, which provides all of this, and allows users to change settings for formatting to their preferences for international users as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants