Merge pull request #1208 from jeroenpeters1986/master

Updates ios, messages, widbatpc
master
Gordon Williams 2022-01-05 08:37:25 +00:00 committed by GitHub
commit ddac45f580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 18 deletions

View File

@ -77,7 +77,7 @@
{ {
"id": "messages", "id": "messages",
"name": "Messages", "name": "Messages",
"version": "0.16", "version": "0.17",
"description": "App to display notifications from iOS and Gadgetbridge", "description": "App to display notifications from iOS and Gadgetbridge",
"icon": "app.png", "icon": "app.png",
"type": "app", "type": "app",
@ -116,7 +116,7 @@
{ {
"id": "ios", "id": "ios",
"name": "iOS Integration", "name": "iOS Integration",
"version": "0.07", "version": "0.08",
"description": "Display notifications/music/etc from iOS devices", "description": "Display notifications/music/etc from iOS devices",
"icon": "app.png", "icon": "app.png",
"tags": "tool,system,ios,apple,messages,notifications", "tags": "tool,system,ios,apple,messages,notifications",
@ -936,7 +936,7 @@
"id": "widbatpc", "id": "widbatpc",
"name": "Battery Level Widget (with percentage)", "name": "Battery Level Widget (with percentage)",
"shortName": "Battery Widget", "shortName": "Battery Widget",
"version": "0.14", "version": "0.15",
"description": "Show the current battery level and charging status in the top right of the clock, with charge percentage", "description": "Show the current battery level and charging status in the top right of the clock, with charge percentage",
"icon": "widget.png", "icon": "widget.png",
"type": "widget", "type": "widget",
@ -5099,7 +5099,7 @@
"tags": "clock", "tags": "clock",
"allow_emulator":true, "allow_emulator":true,
"supports" : ["BANGLEJS2"], "supports" : ["BANGLEJS2"],
"type": "clock", "type": "clock",
"storage": [ "storage": [
{"name":"contourclock.app.js","url":"app.js"}, {"name":"contourclock.app.js","url":"app.js"},
{"name":"contourclock.img","url":"app-icon.js","evaluate":true} {"name":"contourclock.img","url":"app-icon.js","evaluate":true}
@ -5334,7 +5334,7 @@
"icon": "andark_icon.png", "icon": "andark_icon.png",
"type": "clock", "type": "clock",
"tags": "clock", "tags": "clock",
"supports" : ["BANGLEJS2"], "supports" : ["BANGLEJS2"],
"readme": "README.md", "readme": "README.md",
"storage": [ "storage": [
{"name":"andark.app.js","url":"app.js"}, {"name":"andark.app.js","url":"app.js"},

View File

@ -2,9 +2,7 @@
0.02: Remove messages on disconnect 0.02: Remove messages on disconnect
0.03: Handling of message actions (ok/clear) 0.03: Handling of message actions (ok/clear)
0.04: Added common bundleId's 0.04: Added common bundleId's
0.05: Added more bundleId's (app-id's which can be used to 0.05: Added more bundleId's (app-id's which can be used to determine a friendly app name in the notifications)
determine a friendly app name in the notifications)
0.06: Fix (not) popupping up old messages 0.06: Fix (not) popupping up old messages
0.07: Added more details from music (instead of Undefined) 0.07: Added more details from music (instead of Undefined), added more app identifiers
Added more app identifiers 0.08: Added more app identifiers, added 'cannot display' in case a message goes empty because of replacements

View File

@ -66,6 +66,7 @@ E.on('notify',msg=>{
"com.apple.mobilecal": "Calendar", "com.apple.mobilecal": "Calendar",
"com.apple.mobilemail": "Mail", "com.apple.mobilemail": "Mail",
"com.apple.mobilephone": "Phone", "com.apple.mobilephone": "Phone",
"com.apple.mobileslideshow": "Pictures",
"com.apple.MobileSMS": "SMS Message", "com.apple.MobileSMS": "SMS Message",
"com.apple.Passbook": "iOS Wallet", "com.apple.Passbook": "iOS Wallet",
"com.apple.podcasts": "Podcasts", "com.apple.podcasts": "Podcasts",
@ -83,6 +84,7 @@ E.on('notify',msg=>{
"com.ifttt.ifttt" : "IFTTT", "com.ifttt.ifttt" : "IFTTT",
"com.jumbo.app" : "Jumbo", "com.jumbo.app" : "Jumbo",
"com.linkedin.LinkedIn" : "LinkedIn", "com.linkedin.LinkedIn" : "LinkedIn",
"com.marktplaats.iphone": "Marktplaats",
"com.microsoft.Office.Outlook" : "Outlook Mail", "com.microsoft.Office.Outlook" : "Outlook Mail",
"com.nestlabs.jasper.release" : "Nest", "com.nestlabs.jasper.release" : "Nest",
"com.netflix.Netflix" : "Netflix", "com.netflix.Netflix" : "Netflix",
@ -90,6 +92,7 @@ E.on('notify',msg=>{
"com.skype.skype": "Skype", "com.skype.skype": "Skype",
"com.skype.SkypeForiPad": "Skype", "com.skype.SkypeForiPad": "Skype",
"com.spotify.client": "Spotify", "com.spotify.client": "Spotify",
"com.storytel.iphone": "Storytel",
"com.strava.stravaride": "Strava", "com.strava.stravaride": "Strava",
"com.tinyspeck.chatlyio": "Slack", "com.tinyspeck.chatlyio": "Slack",
"com.toyopagroup.picaboo": "Snapchat", "com.toyopagroup.picaboo": "Snapchat",
@ -98,6 +101,8 @@ E.on('notify',msg=>{
"com.vilcsak.bitcoin2": "Coinbase", "com.vilcsak.bitcoin2": "Coinbase",
"com.wordfeud.free": "WordFeud", "com.wordfeud.free": "WordFeud",
"com.zhiliaoapp.musically": "TikTok", "com.zhiliaoapp.musically": "TikTok",
"io.robbie.HomeAssistant": "Home Assistant",
"net.weks.prowl": "Prowl",
"net.whatsapp.WhatsApp": "WhatsApp", "net.whatsapp.WhatsApp": "WhatsApp",
"nl.ah.Appie": "Albert Heijn", "nl.ah.Appie": "Albert Heijn",
"nl.postnl.TrackNTrace": "PostNL", "nl.postnl.TrackNTrace": "PostNL",
@ -118,7 +123,7 @@ E.on('notify',msg=>{
new : msg.new, new : msg.new,
title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer), title : msg.title&&E.decodeUTF8(msg.title, unicodeRemap, replacer),
subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer), subject : msg.subtitle&&E.decodeUTF8(msg.subtitle, unicodeRemap, replacer),
body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) body : msg.message&&E.decodeUTF8(msg.message, unicodeRemap, replacer) || "Cannot display"
}); });
// TODO: posaction/negaction? // TODO: posaction/negaction?
}); });

View File

@ -23,3 +23,4 @@
0.14: Hide widget when all unread notifications are dismissed from phone 0.14: Hide widget when all unread notifications are dismissed from phone
0.15: Don't buzz when Quiet Mode is active 0.15: Don't buzz when Quiet Mode is active
0.16: Fix text wrapping so it fits the screen even if title is big (fix #1147) 0.16: Fix text wrapping so it fits the screen even if title is big (fix #1147)
0.17: Fix: Get dynamic dimensions of notify icon, fixed notification font

View File

@ -1,8 +1,9 @@
WIDGETS["messages"]={area:"tl",width:0,draw:function() { WIDGETS["messages"]={area:"tl", width:0, iconwidth:23,
draw:function() {
Bangle.removeListener('touch', this.touch); Bangle.removeListener('touch', this.touch);
if (!this.width) return; if (!this.width) return;
var c = (Date.now()-this.t)/1000; var c = (Date.now()-this.t)/1000;
g.reset().clearRect(this.x,this.y,this.x+this.width,this.y+23); g.reset().clearRect(this.x, this.y, this.x+this.width, this.y+this.iconwidth);
g.drawImage((c&1) ? atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+DAADDAADDAADDwAPD8A/DOBzDDn/DA//DAHvDAPvjAPvjAPvjAPvh///gf/vAAD+AAB8AAAAA==") : atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+D///D///A//8CP/xDj/HD48DD+B8D/D+D/3vD/vvj/vvj/vvj/vvh/v/gfnvAAD+AAB8AAAAA=="), this.x, this.y); g.drawImage((c&1) ? atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+DAADDAADDAADDwAPD8A/DOBzDDn/DA//DAHvDAPvjAPvjAPvjAPvh///gf/vAAD+AAB8AAAAA==") : atob("GBiBAAAAAAAAAAAAAAAAAAAAAB//+D///D///A//8CP/xDj/HD48DD+B8D/D+D/3vD/vvj/vvj/vvj/vvh/v/gfnvAAD+AAB8AAAAA=="), this.x, this.y);
//if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute //if (c<60) Bangle.setLCDPower(1); // keep LCD on for 1 minute
let settings = require('Storage').readJSON("messages.settings.json", true) || {}; let settings = require('Storage').readJSON("messages.settings.json", true) || {};
@ -17,7 +18,7 @@ WIDGETS["messages"]={area:"tl",width:0,draw:function() {
WIDGETS["messages"].t=Date.now(); // first time WIDGETS["messages"].t=Date.now(); // first time
WIDGETS["messages"].l=Date.now()-10000; // last buzz WIDGETS["messages"].l=Date.now()-10000; // last buzz
if (quiet) WIDGETS["messages"].t -= 500000; // if quiet, set last time in the past so there is no buzzing if (quiet) WIDGETS["messages"].t -= 500000; // if quiet, set last time in the past so there is no buzzing
WIDGETS["messages"].width=64; WIDGETS["messages"].width=this.iconwidth;
Bangle.drawWidgets(); Bangle.drawWidgets();
Bangle.setLCDPower(1);// turns screen on Bangle.setLCDPower(1);// turns screen on
},hide:function() { },hide:function() {
@ -37,7 +38,7 @@ WIDGETS["messages"]={area:"tl",width:0,draw:function() {
b(); b();
},touch:function(b,c) { },touch:function(b,c) {
var w=WIDGETS["messages"]; var w=WIDGETS["messages"];
if (!w||!w.width||c.x<w.x||c.x>w.x+w.width||c.y<w.y||c.y>w.y+23) return; if (!w||!w.width||c.x<w.x||c.x>w.x+w.width||c.y<w.y||c.y>w.y+w.iconwidth) return;
load("messages.app.js"); load("messages.app.js");
}}; }};
/* We might have returned here if we were in the Messages app for a /* We might have returned here if we were in the Messages app for a
@ -46,4 +47,4 @@ want to buzz but should still show that there are unread messages. */
if (global.MESSAGES===undefined) (function() { if (global.MESSAGES===undefined) (function() {
var messages = require("Storage").readJSON("messages.json",1)||[]; var messages = require("Storage").readJSON("messages.json",1)||[];
if (messages.some(m=>m.new)) WIDGETS["messages"].show(true); if (messages.some(m=>m.new)) WIDGETS["messages"].show(true);
})(); })();

View File

@ -11,3 +11,4 @@
0.12: Fixed for Bangle 2 0.12: Fixed for Bangle 2
0.13: Fillbar setting added, see README 0.13: Fillbar setting added, see README
0.14: Fix drawing the bar when charging 0.14: Fix drawing the bar when charging
0.15: Added option to always display the icon when charging (useful if 'hide if charge greater than' is enabled)

View File

@ -13,6 +13,7 @@
'fillbar': false, 'fillbar': false,
'charger': true, 'charger': true,
'hideifmorethan': 100, 'hideifmorethan': 100,
'alwaysoncharge': false,
} }
// ...and overwrite them with any saved values // ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings // This way saved values are preserved if a new version adds more settings
@ -68,6 +69,11 @@
format: x => x+"%", format: x => x+"%",
onchange: save('hideifmorethan'), onchange: save('hideifmorethan'),
}, },
'Show on charge': { // Not sure if this is readable enough in the 'big' menu
value: s.alwaysoncharge,
format: onOffFormat,
onchange: save('alwaysoncharge'),
},
} }
E.showMenu(menu) E.showMenu(menu)
}) })

View File

@ -29,6 +29,7 @@
'percentage': true, 'percentage': true,
'charger': true, 'charger': true,
'hideifmorethan': 100, 'hideifmorethan': 100,
'alwaysoncharge': false,
}; };
Object.keys(DEFAULTS).forEach(k=>{ Object.keys(DEFAULTS).forEach(k=>{
if (settings[k]===undefined) settings[k]=DEFAULTS[k] if (settings[k]===undefined) settings[k]=DEFAULTS[k]
@ -67,8 +68,11 @@
var w = 40; var w = 40;
if (Bangle.isCharging() && setting('charger')) if (Bangle.isCharging() && setting('charger'))
w += 16; w += 16;
if (E.getBattery() > setting('hideifmorethan')) if (E.getBattery() > setting('hideifmorethan')) {
w = 0; w = 0;
if( Bangle.isCharging() && setting('alwaysoncharge') === true)
w = 56;
}
var changed = WIDGETS["batpc"].width != w; var changed = WIDGETS["batpc"].width != w;
WIDGETS["batpc"].width = w; WIDGETS["batpc"].width = w;
return changed; return changed;

2
core

@ -1 +1 @@
Subproject commit 5a5957714d4aa04413329f57c03e6de0cfb74caf Subproject commit 2a8e872ecb143a10e53273b4d3473164e104e1d3