voldisp: new app that displays volume change on Android device
parent
1f2e693f7f
commit
5fcb519888
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: New App!
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -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});
|
||||||
|
}
|
||||||
|
|
@ -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 not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in New Issue