diff --git a/apps/messagesmusic/ChangeLog b/apps/messagesmusic/ChangeLog new file mode 100644 index 000000000..5560f00bc --- /dev/null +++ b/apps/messagesmusic/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/messagesmusic/README.md b/apps/messagesmusic/README.md new file mode 100644 index 000000000..7aa9209df --- /dev/null +++ b/apps/messagesmusic/README.md @@ -0,0 +1,15 @@ +Hacky app that uses Messages app and it's library to push a message that triggers the music controls. It's nearly not an app, and yet it moves. + +This app require Messages setting 'Auto-open Music' to be 'Yes'. If it isn't, the app will change it to 'Yes' and let it stay that way. + +Making the music controls accessible this way lets one start a music stream on the phone in some situations even though the message app didn't receive a music message from gadgetbridge to begin with. (I think.) + +It is suggested to use Messages Music along side the app Quick Launch. + +Messages Music v0.01 has been verified to work with Messages v0.31 on Bangle.js 2 fw2v13. + +Music Messages should work with forks of the original Messages app. At least as long as functions pushMessage() in the library and showMusicMessage() in app.js hasn't been changed too much. + +Messages app is created by Gordon Williams with contributions from [Jeroen Peters](https://github.com/jeroenpeters1986). + +The icon used for this app is from [https://icons8.com](https://icons8.com). diff --git a/apps/messagesmusic/app-icon.js b/apps/messagesmusic/app-icon.js new file mode 100644 index 000000000..5252570b6 --- /dev/null +++ b/apps/messagesmusic/app-icon.js @@ -0,0 +1 @@ +require("heatshrink").decompress(atob("mEwwhC/AFXdAAQVVDKQWHDB0NC5PQCyoYMCxZJKFxgwKCxowJC6xGOJBALE6YwRBQnf+YXPIwvf/4YKJAgXHDBQXNDBIXO/89C5YKFC4gYIC54YHC6AYGC6IYFC9JHWO6ynLa64XJ+YWGC5wWIC5oWJC4p4F74WKOwgXG6YWKC4xIFABRGFYI4uPC7JIOIw4wPCxAwNFxIYMCxZJLCxgYJCxwZGCqIA/AC4=")) diff --git a/apps/messagesmusic/app.js b/apps/messagesmusic/app.js new file mode 100644 index 000000000..a6f7e075e --- /dev/null +++ b/apps/messagesmusic/app.js @@ -0,0 +1,15 @@ +let showMusic = () => { + Bangle.CLOCK = 1; // To pass condition in messages library + require('messages').pushMessage({"t":"add","artist":" ","album":" ","track":" ","dur":0,"c":-1,"n":-1,"id":"music","title":"Music","state":"play","new":true}); + Bangle.CLOCK = undefined; +}; + +var settings = require('Storage').readJSON('messages.settings.json', true) || {}; //read settings if they exist else set to empty dict +if (!settings.openMusic) { + settings.openMusic = true; // This app/hack works as intended only if this setting is true + require('Storage').writeJSON('messages.settings.json', settings); + E.showMessage("First run:\n\nMessages setting\n\n 'Auto-Open Music'\n\n set to 'Yes'"); + setTimeout(()=>{showMusic();}, 5000); +} else { + showMusic(); +} diff --git a/apps/messagesmusic/app.js~ b/apps/messagesmusic/app.js~ new file mode 100644 index 000000000..a02c7704f --- /dev/null +++ b/apps/messagesmusic/app.js~ @@ -0,0 +1,15 @@ +let showMusic = () => { + Bangle.CLOCK = 1; // To pass condition in messages library + require('messages').pushMessage({"t":"add","artist":" ","album":" ","track":" ","dur":0,"c":-1,"n":-1,"id":"music","title":"Music","state":"play","new":true}); + Bangle.CLOCK = undefined; +}; + +var settings = require('Storage').readJSON('messages.settings.json', true) || {}; //read settings if they exist else set to empty dict +if (!settings.openMusic) { + settings.openMusic = true; // This app/hack works as intended only if this setting is true + require('Storage').writeJSON('messages.settings.json', settings); + E.showMessage("First run:\n\nMessages setting\n\n 'Auto-Open Music'\n\n set to 'Yes'"); + setTimeout(()=>{showMusic();}, 5000); +} else { + showMusic(); +}; diff --git a/apps/messagesmusic/app.png b/apps/messagesmusic/app.png new file mode 100644 index 000000000..9d2967bba Binary files /dev/null and b/apps/messagesmusic/app.png differ diff --git a/apps/messagesmusic/metadata.json b/apps/messagesmusic/metadata.json new file mode 100644 index 000000000..edc6835ed --- /dev/null +++ b/apps/messagesmusic/metadata.json @@ -0,0 +1,18 @@ +{ + "id": "messagesmusic", + "name":"Messages Music", + "version":"0.01", + "description": "Uses Messages library to push a music message which in turn displays Messages app music controls", + "icon":"app.png", + "type": "app", + "tags":"tool,music", + "screenshots": [{"url":"screenshot.png"}], + "supports": ["BANGLEJS","BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"messagesmusic.app.js","url":"app.js"}, + {"name":"messagesmusic.img","url":"app-icon.js","evaluate":true} + ], + "dependencies": {"messages":"app"} + +} diff --git a/apps/messagesmusic/screenshot.png b/apps/messagesmusic/screenshot.png new file mode 100644 index 000000000..986b869f8 Binary files /dev/null and b/apps/messagesmusic/screenshot.png differ