1
0
Fork 0

#1132: Messages: Allow disabling repetition of buzzer

master
Jeroen Peters 2022-02-19 00:23:12 +01:00
parent a20e7d36c3
commit e172aa4927
4 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@
0.10: Respect the 'new' attribute if it was set from iOS integrations
0.11: Open app when touching the widget (Bangle.js 2 only)
0.12: Extra app-specific notification icons
New animated notifcationicon (instead of large blinking 'MESSAGES')
New animated notification icon (instead of large blinking 'MESSAGES')
Added screenshots
0.13: Add /*LANG*/ comments for internationalisation
Add 'Delete All' option to message options
@ -31,4 +31,6 @@
0.19: Use a larger font for message text if it'll fit
0.20: Allow tapping on the body to show a scrollable view of the message and title in a bigger font (fix #1405, #1031)
0.21: Improve list readability on dark theme
0.22: Allow repeat to be switched Off, so there is no buzzing repetition
0.22: Allow repeat to be switched Off, so there is no buzzing repetition.
Also gave the widget a pixel more room to the right

View File

@ -1,8 +1,8 @@
{
"id": "messages",
"name": "Messages",
"version": "0.25",
"description": "App to display notifications from iOS and Gadgetbridge",
"version": "0.22",
"description": "App to display notifications from iOS and Gadgetbridge/Android",
"icon": "app.png",
"type": "app",
"tags": "tool,system",

View File

@ -13,7 +13,6 @@
}
var vibPatterns = [/*LANG*/"Off", ".", "-", "--", "-.-", "---"];
var currentVib = settings().vibrate;
var mainmenu = {
"" : { "title" : /*LANG*/"Messages" },
"< Back" : back,

View File

@ -1,5 +1,5 @@
WIDGETS["messages"]={area:"tl", width:0, iconwidth:24,
draw:function(buzzed_once) {
draw:function() {
Bangle.removeListener('touch', this.touch);
if (!this.width) return;
var c = (Date.now()-this.t)/1000;
@ -8,12 +8,12 @@ draw:function(buzzed_once) {
//if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute
let settings = require('Storage').readJSON("messages.settings.json", true) || {};
if (settings.repeat===undefined) settings.repeat = 4;
else if (settings.repeat===0) settings.repeat = (settings.unreadTimeout+241)*1000; // best way to no-repeat and keep next code
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
this.l = Date.now();
WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds
}
if (settings.repeat===0 && buzzed_once===true) settings.repeat = (settings.unreadTimeout+241)*1000; // Dont buzz again after this initial one
setTimeout(()=>WIDGETS["messages"].draw(true), 1000);
setTimeout(()=>WIDGETS["messages"].draw(), 1000);
if (process.env.HWVERSION>1) Bangle.on('touch', this.touch);
},show:function(quiet) {
WIDGETS["messages"].t=Date.now(); // first time