Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

voldisp: new app that displays volume change on Android device #3780

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions apps/voldisp/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.01: New App!
Binary file added apps/voldisp/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions apps/voldisp/boot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
let timeout;
let onMusicVolume = (volPercent)=>{
if (timeout) {clearTimeout(timeout); timeout=undefined;}

if (Bangle.CLOCK) {
let barWidth = g.getWidth()*volPercent/100;
g.
setColor(0x0000).fillRect(0,0,g.getWidth(),24).
setColor(0xF800).fillRect(0,0,barWidth,19).
setColor(0xFFFF).setFont("12x20").setFontAlign(1,-1).
drawString("volume",barWidth,1);

let goAway = ()=>{
let isAllWidgetsHidden = true;
for (var w of global.WIDGETS) {
if (!w._draw) {
isAllWidgetsHidden = false;
break;
}
}

if (global.WIDGETS && !isAllWidgetsHidden) {
Bangle.drawWidgets();
} else if (Bangle.uiRedraw) {
Bangle.uiRedraw();
} else {
Bangle.load();
}
};
timeout = setTimeout(goAway, 3*1000);
}
};
Bangle.on("musicVolume", onMusicVolume);
//GB({t:"audio",v:10});
}
15 changes: 15 additions & 0 deletions apps/voldisp/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ "id": "voldisp",
"name": "Display Volume for Android",
"version":"0.01",
"description": "Display the media volume of your android device when it's changed. A bar shows up at the top of your Bangles screen. (Needs recent Gadgetbridge nightly or stable ver. 85 once out)",
"icon": "app.png",
"tags": "audio,media,android,volume,sound",
"type": "bootloader",
"supports" : ["BANGLEJS2"],
"screenshots" : [
{ "url":"screenshot.png" }
],
"storage": [
{"name":"voldisp.boot.js","url":"boot.js"}
]
}
Binary file added apps/voldisp/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.