diff --git a/apps/gbmusic/ChangeLog b/apps/gbmusic/ChangeLog index 8b1a3e4aa..cf010a771 100644 --- a/apps/gbmusic/ChangeLog +++ b/apps/gbmusic/ChangeLog @@ -7,3 +7,4 @@ 0.07: Fix "previous" button image 0.08: Fix scrolling title background color 0.09: Move event listener from widget to boot code, stops music from showing up in messages +0.10: Simplify touch events diff --git a/apps/gbmusic/README.md b/apps/gbmusic/README.md index 5d06164c2..7bd1486de 100644 --- a/apps/gbmusic/README.md +++ b/apps/gbmusic/README.md @@ -3,9 +3,10 @@ If you have an Android phone with Gadgetbridge, this app allows you to view and control music playback. -| Bangle.js 1 | Bangle.js 2 | -|:-------------------------------------------|:-------------------------------------------| -| ![Screenshot: Bangle 1](screenshot_v1.png) | ![Screenshot: Bangle 2](screenshot_v2.png) | +| Bangle.js 1 | Bangle.js 2 | +|:---------------------------------------------------------|:---------------------------------------------------------| +| ![Screenshot: Bangle 1 Dark theme](screenshot_v1_d.png) | ![Screenshot: Bangle 2 Darm theme](screenshot_v2_d.png) | +| ![Screenshot: Bangle 1 Light theme](screenshot_v1_l.png) | ![Screenshot: Bangle 2 Light theme](screenshot_v2_l.png) | Download the [latest Gadgetbridge for Android here](https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/). @@ -40,9 +41,7 @@ Disable double/triple pressing Middle Button: always simply toggle play/pause. * Button 3 (*Bangle.js 1*): Volume down ### Touch -* Left: Pause/previous song -* Right: Next song/resume -* Center: Toggle play/pause +* Touch: Toggle play/pause * Swipe left/right: Next/previous song * Swipe up/down (*Bangle.js 2*): Volume up/down diff --git a/apps/gbmusic/app.js b/apps/gbmusic/app.js index c8395f745..efcfdac22 100644 --- a/apps/gbmusic/app.js +++ b/apps/gbmusic/app.js @@ -195,9 +195,7 @@ function makeUI() { { type: "h", c: [ {width: 3}, - {id: "prev", type: "custom", height: 15, width: 15, icon: "previous", render: rIcon, bgCol: g.theme.bg}, {id: "date", type: "txt", halign: 0, valign: 1, label: "", font: "8%", fillx: 1, bgCol: g.theme.bg}, - {id: "next", type: "custom", height: 15, width: 15, icon: "next", render: rIcon, bgCol: g.theme.bg}, BANGLE2 ? {width: 3} : {id: "down", type: "txt", label: " -", font: "6x8:2"}, ], }, @@ -295,16 +293,10 @@ function drawDateTime() { } function drawControls() { - let l = layout; + if (BANGLE2) return; const cc = a => (a ? "#f00" : "#0f0"); // control color: red for active, green for inactive - if (!BANGLE2) { - l.up.col = cc("volumeup" in tCommand); - l.down.col = cc("volumedown" in tCommand); - } - l.prev.icon = (stat==="play") ? "pause" : "previous"; - l.prev.col = cc("prev" in tCommand || "pause" in tCommand); - l.next.icon = (stat==="play") ? "next" : "play"; - l.next.col = cc("next" in tCommand || "play" in tCommand); + layout.up.col = cc("volumeup" in tCommand); + layout.down.col = cc("volumedown" in tCommand); layout.render(); } @@ -473,37 +465,16 @@ function sendCommand(command) { drawControls(); } -// touch/swipe: navigation function togglePlay() { sendCommand(stat==="play" ? "pause" : "play"); } -function pausePrev() { - sendCommand(stat==="play" ? "pause" : "previous"); -} -function nextPlay() { - sendCommand(stat==="play" ? "next" : "play"); -} /** * Setup touch+swipe for Bangle.js 1 */ function touch1() { - Bangle.on("touch", side => { - if (!Bangle.isLCDOn()) {return;} // for <2v10 firmware - switch(side) { - case 1: - pausePrev(); - break; - case 2: - nextPlay(); - break; - default: - togglePlay(); - break; - } - }); + Bangle.on("touch", togglePlay); Bangle.on("swipe", dir => { - if (!Bangle.isLCDOn()) {return;} // for <2v10 firmware sendCommand(dir===1 ? "previous" : "next"); }); } @@ -511,16 +482,7 @@ function touch1() { * Setup touch+swipe for Bangle.js 2 */ function touch2() { - Bangle.on("touch", (side, xy) => { - const ar = Bangle.appRect; - if (xy.xar.x+ar.w*2/3) { - nextPlay(); - } else { - togglePlay(); - } - }); + Bangle.on("touch", togglePlay); // swiping let drag; Bangle.on("drag", e => { diff --git a/apps/gbmusic/metadata.json b/apps/gbmusic/metadata.json index f578f1f48..0ded80452 100644 --- a/apps/gbmusic/metadata.json +++ b/apps/gbmusic/metadata.json @@ -2,10 +2,11 @@ "id": "gbmusic", "name": "Gadgetbridge Music Controls", "shortName": "Music Controls", - "version": "0.09", + "version": "0.10", "description": "Control the music on your Gadgetbridge-connected phone", "icon": "icon.png", - "screenshots": [{"url":"screenshot_v1.png"},{"url":"screenshot_v2.png"}], + "screenshots": [{"url":"screenshot_v1_d.png"},{"url":"screenshot_v1_l.png"}, + {"url":"screenshot_v2_d.png"},{"url":"screenshot_v2_l.png"}], "type": "app", "tags": "tools,bluetooth,gadgetbridge,music", "supports": ["BANGLEJS","BANGLEJS2"], diff --git a/apps/gbmusic/screenshot_v1.png b/apps/gbmusic/screenshot_v1.png deleted file mode 100644 index 3b290e459..000000000 Binary files a/apps/gbmusic/screenshot_v1.png and /dev/null differ diff --git a/apps/gbmusic/screenshot_v1_d.png b/apps/gbmusic/screenshot_v1_d.png new file mode 100644 index 000000000..c85e8b8a6 Binary files /dev/null and b/apps/gbmusic/screenshot_v1_d.png differ diff --git a/apps/gbmusic/screenshot_v1_l.png b/apps/gbmusic/screenshot_v1_l.png new file mode 100644 index 000000000..725b21839 Binary files /dev/null and b/apps/gbmusic/screenshot_v1_l.png differ diff --git a/apps/gbmusic/screenshot_v2.png b/apps/gbmusic/screenshot_v2.png deleted file mode 100644 index b89b5022e..000000000 Binary files a/apps/gbmusic/screenshot_v2.png and /dev/null differ diff --git a/apps/gbmusic/screenshot_v2_d.png b/apps/gbmusic/screenshot_v2_d.png new file mode 100644 index 000000000..63e502cef Binary files /dev/null and b/apps/gbmusic/screenshot_v2_d.png differ diff --git a/apps/gbmusic/screenshot_v2_l.png b/apps/gbmusic/screenshot_v2_l.png new file mode 100644 index 000000000..521d304aa Binary files /dev/null and b/apps/gbmusic/screenshot_v2_l.png differ