-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.01: First release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Messages Clockinfo | ||
|
||
A simple messages counter for clockinfo enabled watchfaces | ||
|
||
## Usage | ||
|
||
You can choose between read and unread counter. | ||
Tap to go to messages UI. | ||
|
||
## Todo / Known Issues | ||
|
||
* GB triggers for message read on phone are not handled | ||
* Icons are not consistent | ||
* Maybe use messageicons for handling icon from last notification | ||
|
||
## Attributions | ||
|
||
All icons used in this app are from [icons8](https://icons8.com). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
(function() { | ||
|
||
var unreadImg = function() { | ||
return atob("GBiBAAAAAAAAAAAAAB//+D///D///D///D///D///D///D5mfD5mfD///D///D///D///D///D///B//+APgAAOAAAOAAAAAAAAAAA=="); | ||
} | ||
var allImg = function() { | ||
return atob("GBiBAAAAAAAAAAB+AAD/AAPDwA8A8B4AeDgAHDgAHDwAPD8A/D/D/D/n/D///D///D///D///D///D///B//+AAAAAAAAAAAAAAAAA=="); | ||
} | ||
|
||
var debug = function(o) { | ||
//console.log(o); | ||
} | ||
var msgUnread; | ||
var msgAll; | ||
var msgs = require("messages"); | ||
|
||
var getAllMGS = function() { | ||
if (msgAll === undefined) { | ||
debug("msgAll is undefined"); | ||
msgAll = msgs.getMessages().filter(m => !['call', 'map', 'music'].includes(m.id)).map(m => m.src).length; | ||
} | ||
return msgAll; | ||
} | ||
|
||
|
||
var getUnreadMGS = function() { | ||
if (msgUnread === undefined) { | ||
debug("msgUnread is undefined"); | ||
msgUnread = msgs.getMessages().filter(m => m.new && !['call', 'map', 'music'].includes(m.id)).map(m => m.src).length; | ||
} | ||
return msgUnread; | ||
} | ||
|
||
var msgCounter = function(type, msg) { | ||
var msgsNow = msgs.getMessages(msg); | ||
msgUnread = msgsNow.filter(m => m.new && !['call', 'map', 'music'].includes(m.id)).map(m => m.src).length; | ||
if (msgUnread === undefined) { | ||
msgUnread = "?"; | ||
} | ||
msgAll = msgsNow.filter(m => !['call', 'map', 'music'].includes(m.id)).map(m => m.src).length; | ||
if (msgAll === undefined) { | ||
msgAll = "?"; | ||
} | ||
info.items[0].emit("redraw"); | ||
} | ||
|
||
var info = { | ||
name: "Messages", | ||
img: unreadImg(), | ||
items: [ | ||
{ name : "Unread", | ||
get : () => { | ||
return { | ||
text : getUnreadMGS(), | ||
img : unreadImg() | ||
}; | ||
}, | ||
show : function() { | ||
Bangle.on("message", msgCounter); | ||
}, | ||
hide : function() { | ||
Bangle.removeListener("message", msgCounter); | ||
}, | ||
run : () => { | ||
require("messages").openGUI(); | ||
} | ||
}, | ||
{ name : "All", | ||
get : () => { | ||
return { | ||
text : getAllMGS(), | ||
img : allImg() // TODO This is omited if category image is not set | ||
}; | ||
}, | ||
show : function() { | ||
Bangle.on("message", msgCounter); | ||
}, | ||
hide : function() { | ||
Bangle.removeListener("message", msgCounter); | ||
}, | ||
run : () => { | ||
require("messages").openGUI(); | ||
} | ||
} | ||
] | ||
}; | ||
return info; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ "id": "clkinfomsg", | ||
"name": "Messages Clockinfo", | ||
"version":"0.01", | ||
"description": "For clocks that display 'clockinfo', this displays the messages count", | ||
"icon": "app.png", | ||
"type": "clkinfo", | ||
"screenshots": [{"url":"screenshot.png"}], | ||
"readme":"README.md", | ||
"tags": "clkinfo", | ||
"supports" : ["BANGLEJS2"], | ||
"dependencies" : { "messages":"app" }, | ||
"storage": [ | ||
{"name":"clkinfomsg.clkinfo.js","url":"clkinfo.js"} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.