#1132: Messages: Allow disabling repetition of buzzer

pull/1470/head
Jeroen Peters 2022-02-18 19:53:11 +01:00
parent cda843c962
commit a4c97850dd
5 changed files with 11 additions and 8 deletions

View File

@ -31,3 +31,4 @@
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

View File

@ -123,7 +123,7 @@ function getMessageImageCol(msg,def) {
"telegram": "#0088cc",
"twitter": "#1da1f2",
"whatsapp": "#4fce5d",
"wordfeud": "#dcc8bd",
"wordfeud": "#e7d3c7",
}[(msg.src||"").toLowerCase()]||(def !== undefined?def:g.theme.fg);
}

View File

@ -1,7 +1,7 @@
{
"id": "messages",
"name": "Messages",
"version": "0.21",
"version": "0.22",
"description": "App to display notifications from iOS and Gadgetbridge",
"icon": "app.png",
"type": "app",

View File

@ -27,8 +27,8 @@
},
/*LANG*/'Repeat': {
value: settings().repeat,
min: 2, max: 10,
format: v => v+"s",
min: 0, max: 10,
format: v => v?v+"s":/*LANG*/"Off",
onchange: v => updateSetting("repeat", v)
},
/*LANG*/'Unread timer': {

View File

@ -1,4 +1,4 @@
WIDGETS["messages"]={area:"tl", width:0, iconwidth:23,
WIDGETS["messages"]={area:"tl", width:0, iconwidth:24,
draw:function() {
Bangle.removeListener('touch', this.touch);
if (!this.width) return;
@ -8,9 +8,11 @@ draw:function() {
//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;
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
this.l = Date.now();
WIDGETS["messages"].buzz(); // buzz every 4 seconds
if(settings.repeat!==0) {
if (c<120 && (Date.now()-this.l)>settings.repeat*1000) {
this.l = Date.now();
WIDGETS["messages"].buzz(); // buzz every settings.repeat seconds
}
}
setTimeout(()=>WIDGETS["messages"].draw(), 1000);
if (process.env.HWVERSION>1) Bangle.on('touch', this.touch);