voldisp: new app that displays volume change on Android device

master
thyttan 2025-03-19 23:18:54 +01:00
parent 1f2e693f7f
commit 5fcb519888
5 changed files with 52 additions and 0 deletions

1
apps/voldisp/ChangeLog Normal file
View File

@ -0,0 +1 @@
0.01: New App!

BIN
apps/voldisp/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

36
apps/voldisp/boot.js Normal file
View File

@ -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});
}

View File

@ -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"}
]
}

BIN
apps/voldisp/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB