-
-
-
-
-
I made an app that replaces the MessagesUI app for people with bad eyesight. So it just displays new messages with a large font and when you push the button, you return to the clock.
Here's the beta-app:
https://kungphoo.github.io/BangleApps/?q=xxl
Here's the code:
https://github.com/KungPhoo/BangleApps/tree/master/apps/xxlmessageMy issues are:
- When the message scrolls and another message arrives, I think, both messages are displays simultaneously, which causes a slowdown.
- g.setFont('6x8:5x9') is slow, maybe? Is there a way skip loading the font again and again for each frame to render?
- Bangle.on('touch', function (b, xy) { xxl.stop(); }); does not really work. I think the drawing keeps the CPU too busy.
- Must I undo the setWatch(xxl.stop, BTN1) when I leave the listener with load()?
- I put all code inside a xxl {} structure. Is there a better way to do this? I was afraid of using global variables in a listener function.
- Is there any way to speed things up?
- When the message scrolls and another message arrives, I think, both messages are displays simultaneously, which causes a slowdown.
-
-
Thank you.
When I receive a message inBangle.on("message", (type, msg) => require("xxlmessage").listener(type, msg));
and I want to show a scrolling message, I need a timeout for the redraw, and a variable holding the current scroll position.
So I can make a global variable like:var scrollPosition=0; var scrollTimeout; exports.messageListener = function(type, msg) { }
Now, when I exit this code, by calling load(), will the global variables 'scrollPosition' etc. be freed from memory?
Also, can I break things, if my global variables have names that are used in other apps or the system?
I ask, because this code is in boot.js and thus always loaded. Will 'require()' load the js file on demand? What is the variable scope? The scope of require(), or global? -
-
-
-
-
I tired to make a messagesUI replacement app. So I uninstalled Messages UI, then installed my app. Now I get the error message:
Device connection failed, Error: Dependency type 'module' not supported
Whenever I try to install the apps "messages" or "Message UI". I did a reset to factory, but still I have this error.
The code I uploaded was:
===boot.js===Bangle.on("message", (type, msg) => require("xxlmessage").listener(type, msg));
===messagexxl.js===
var drawTimeout; // = undefined; var xpos = 2*g.getWidth(); var loopCount=0; // schedule a draw for the next 30 FPS function queueDraw() { if (drawTimeout) {clearTimeout(drawTimeout);} drawTimeout = setTimeout(function() { drawTimeout = undefined; draw(); }, 32 - (Date.now() % 32)); } function drawBackground() { g.setBgColor(0,0,0); g.setColor(1,1,1); g.clear(); } function stop(){ if (drawTimeout) {clearTimeout(drawTimeout);} load(); } function draw(){ Bangle.setLocked(false); // keep the touch input active drawBackground(); g.setFont('6x8:5x10'); g.setFontAlign(-1, -1); var gw = g.getWidth(); var text = "This is a test with a longer message to try..."; var wtot = g.stringMetrics(text).width; g.setBgColor('#000000'); g.setColor('#ffffff'); g.drawString(text, xpos, 0); g.drawString(text, xpos-gw-32, g.getHeight()/2); g.reset(); xpos -= 3; if(xpos < -wtot-gw*2 ) { ++loopCount; if(loopCount > 2){ stop(); } xpos=3*gw; } // widget redraw Bangle.drawWidgets(); queueDraw(); } Bangle.loadWidgets(); Bangle.on("message", (type, msg) => { if (!msg) return; if(type === 'text' && msg.t !== 'remove'){ msg.handled = true; // don't do anything else with the message draw(); } }); Bangle.on('touch', function(b,xy){ stop(); }); Bangle.setUI("clock"); Bangle.drawWidgets();
=== metadata.json ===
{ "id": "xxlmessage", "name": "XXL Message", "version": "0.01", "shortName": "XXL Msg", "description": "App to display large notifications from iOS and Gadgetbridge/Android", "icon": "app.png", "type": "app", "tags": "tool,system", "supports": ["BANGLEJS","BANGLEJS2"], "readme": "README.md", "screenshots": [{"url":"screenshot.png"}], "storage": [ {"name":"xxlmessage.app.js","url":"xxlmessage.js"}, {"name":"xxlmessage.boot.js","url":"boot.js"}, {"name":"xxlmessage.img","url":"app-icon.js","evaluate":true} ] }
-
-
What is the bare minimum code required to show a message from Gadgetbridge?
My eyes are too bad for reading the messages ui app. So I made a large font 2 line scroller that scrolls the message text two times and keeps the touch screen active. When you touch it, the clock loads.
Very simple. But, how would I get notified about a new message? -
-
I put mine on a 3D printer heatbed. At about 83° I was able to pull it open. Please start with 70° and slowly raise it to prevent a fire. Watch youtube videos of a burning smart phone battery - It's dangerous!
So. I dried mine and sealed it back with epoxy. My button is a bit hard to press now and the vibration is dead. 😟 But bluetooth is working and it's water proof now. -
-
-
-
Same here. Took off the watch, then it started to behave as if the button gets pressed every 5 or so seconds.
I sealed the back hole with epoxy long ago. Might be related to the current weather here in Germany.
I'll try to open and dry it.
So for Bangle.js3, please make it suitable for deep sea diving ;) -
-
-
-
I set gadgetbridge to notify me when the battery drops below 30%. Howver, the watch reports non monotonious values like 32..29..31..28, so GB notifies me like mad.
Can't we remember and report the lowest measured value unless the watch was charged to fix this? I had to turn bluetooth off, because I was far from the charger.
I got another watch, that showed the same problem again after a year and a 3rd one to use now. I opened the 2nd watch and it was not wet. The button just permanently toggles pressing for no reason. When I unplug the button from the pcb, it stops doing that. I fear that the button or it's board is.. not tough enough.
Is there a spare part button, I can get? I wish I could find a water proof button that sort of fits into the case...