feat: settings page

This commit is contained in:
2026-07-27 00:16:46 -04:00
parent 1029586c6d
commit bc9cad78cb
9 changed files with 231 additions and 12 deletions
+17 -9
View File
@@ -22,17 +22,19 @@ plus `Repeat`/`Shuffle` leading icons on the chips) from
individual vector drawables (leaner but manual); the extended dep + R8 was the
best effort/quality trade.
## [ ] 2. Settings menu
## [x] 2. Settings menu
A dedicated settings screen where the user can view every setting and reset it.
Done. `SettingsScreen` (reached via a gear icon on the now-playing screen) shows
the current server (host/port) with **Change server** (disconnect → connect
form) and **Reset settings** (confirm dialog → clears DataStore + disconnects).
- Currently settings (host/port) are only editable by hitting **Disconnect** to
get back to the connect form. Add a real settings route.
- Include a **Reset** action that clears DataStore (add a `clear()` to
`SettingsRepository`).
- Will likely want simple navigation (Navigation-Compose, or a screen enum in
`PlayerViewModel`/`AppScreen`).
- Room to grow: password field, connection timeout, theme, keep-screen-on.
- `SettingsRepository.clear()` wipes DataStore; `MpdConnectionManager.resetSettings()`
clears + disconnects.
- Navigation is lightweight state (`showSettings` in `MusicRemoteApp`, only over
the player screen; a `LaunchedEffect` drops it when leaving the player) — no
Navigation-Compose dependency yet.
- Room to grow: password field, connection timeout, theme, keep-screen-on — and
if screens multiply, revisit adopting Navigation-Compose.
## [x] 3. Cast-style volume + OS media integration
@@ -55,6 +57,12 @@ Done — full MALP-style **OS integration**, not just in-app. Architecture:
- Needs `POST_NOTIFICATIONS` (requested in `MainActivity`) +
`FOREGROUND_SERVICE[_MEDIA_PLAYBACK]`.
- In-app **`CastIndicator`** ("Controlling <host>") still shown above the slider.
- **Foreground key handling** (`VolumeKeyDispatcher`, delegated from
`MainActivity.dispatchKeyEvent`): while focused, volume keys are consumed and
drive the server silently — no system volume slider (the app's own slider is
the feedback). Backgrounded, the `VolumeProvider` takes over (system UI is fine
there). Gated by `MpdConnectionManager.isControllingVolume`; passes through to
local volume when not connected.
Notes: verified on the FiiO via injected key events (a rotary volume knob may not
emit `VOLUME_UP/DOWN` — hardware-dependent). Album art in the notification/session