From 613d5156fa4e9aea60b36df1a02e42787f61c5d3 Mon Sep 17 00:00:00 2001 From: Honey Date: Mon, 15 Jun 2026 23:54:11 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20settings=20order=20now=20matches=20web?= =?UTF-8?q?=20=E2=80=94=20Theme=20=E2=86=92=20Bibliothek=20=E2=86=92=20ABS?= =?UTF-8?q?=20=E2=86=92=20Discover=20APIs=20=E2=86=92=20Navidrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- .../novasonic/app/ui/screen/SettingsScreen.kt | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/android/app/src/main/kotlin/com/novasonic/app/ui/screen/SettingsScreen.kt b/android/app/src/main/kotlin/com/novasonic/app/ui/screen/SettingsScreen.kt index 6f578e6..58249f8 100644 --- a/android/app/src/main/kotlin/com/novasonic/app/ui/screen/SettingsScreen.kt +++ b/android/app/src/main/kotlin/com/novasonic/app/ui/screen/SettingsScreen.kt @@ -83,39 +83,29 @@ fun SettingsScreen() { // ── Save button (TOP) ──────────────────────────────────────────────── SaveButton(vm, state.isSaving, state.savedOk, state.error) - // ── 🌐 Navidrome Server ────────────────────────────────────────────── - SectionHeader("🌐 Navidrome Server") - - NsTextField( - value = state.serverUrl, onValueChange = vm::onServerUrl, - label = "Server URL", placeholder = "https://musik.beispiel.de", - keyboardType = KeyboardType.Uri, - ) - NsTextField( - value = state.username, onValueChange = vm::onUsername, - label = "Benutzername", - ) - NsTextField( - value = state.password, onValueChange = vm::onPassword, - label = "Passwort", - hint = "(unverändert lassen wenn kein Reset gewünscht)", - visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(), - keyboardType = KeyboardType.Password, - trailingIcon = { - IconButton(onClick = { showPassword = !showPassword }) { - Icon( - if (showPassword) Icons.Default.VisibilityOff else Icons.Default.Visibility, - contentDescription = null, tint = NsOnSurface2, - ) - } - }, - ) + // ── 🎨 Theme ───────────────────────────────────────────────────────── + SectionHeader("🎨 Theme") + ThemePicker(currentThemeId = state.theme, onSelect = { id -> vm.onTheme(id); applyNsTheme(id) }) Spacer(Modifier.height(4.dp)) // ── 📊 Bibliothek ──────────────────────────────────────────────────── SectionHeader("📊 Bibliothek") + Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) { + Column(Modifier.weight(1f)) { + Text("Abspielhäufigkeit anzeigen", fontFamily = Outfit, fontWeight = FontWeight.Medium, fontSize = 14.sp, color = NsOnSurface) + Text("Zeigt Wiedergabezähler in Song-Reihen an", fontFamily = Outfit, fontSize = 12.sp, color = NsOnSurface2) + } + Switch( + checked = state.showPlayCount, onCheckedChange = vm::onShowPlayCount, + colors = SwitchDefaults.colors( + checkedThumbColor = NsBackground, checkedTrackColor = NsAccent, + uncheckedThumbColor = NsOnSurface2, + ), + ) + } + ExposedDropdownMenuBox(expanded = scrobbleExpanded, onExpandedChange = { scrobbleExpanded = it }) { OutlinedTextField( value = SCROBBLE_OPTIONS.firstOrNull { it.first == state.scrobbleMode }?.second ?: "30 Sekunden", @@ -136,26 +126,6 @@ fun SettingsScreen() { } } - Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp)) { - Column(Modifier.weight(1f)) { - Text("Abspielhäufigkeit anzeigen", fontFamily = Outfit, fontWeight = FontWeight.Medium, fontSize = 14.sp, color = NsOnSurface) - Text("Zeigt Wiedergabezähler in Song-Reihen an", fontFamily = Outfit, fontSize = 12.sp, color = NsOnSurface2) - } - Switch( - checked = state.showPlayCount, onCheckedChange = vm::onShowPlayCount, - colors = SwitchDefaults.colors( - checkedThumbColor = NsBackground, checkedTrackColor = NsAccent, - uncheckedThumbColor = NsOnSurface2, - ), - ) - } - - Spacer(Modifier.height(4.dp)) - - // ── 🎨 Theme ───────────────────────────────────────────────────────── - SectionHeader("🎨 Theme") - ThemePicker(currentThemeId = state.theme, onSelect = { id -> vm.onTheme(id); applyNsTheme(id) }) - Spacer(Modifier.height(4.dp)) // ── 📚 Audiobookshelf ──────────────────────────────────────────────── @@ -201,6 +171,36 @@ fun SettingsScreen() { ) ConnStatusRow(status = state.backendStatus, label = "Nicht konfiguriert", onTest = vm::testBackend) + Spacer(Modifier.height(4.dp)) + + // ── 🌐 Navidrome Server ────────────────────────────────────────────── + SectionHeader("🌐 Navidrome Server") + + NsTextField( + value = state.serverUrl, onValueChange = vm::onServerUrl, + label = "Server URL", placeholder = "https://musik.beispiel.de", + keyboardType = KeyboardType.Uri, + ) + NsTextField( + value = state.username, onValueChange = vm::onUsername, + label = "Benutzername", + ) + NsTextField( + value = state.password, onValueChange = vm::onPassword, + label = "Passwort", + hint = "(unverändert lassen wenn kein Reset gewünscht)", + visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(), + keyboardType = KeyboardType.Password, + trailingIcon = { + IconButton(onClick = { showPassword = !showPassword }) { + Icon( + if (showPassword) Icons.Default.VisibilityOff else Icons.Default.Visibility, + contentDescription = null, tint = NsOnSurface2, + ) + } + }, + ) + Spacer(Modifier.height(8.dp)) // ── Save button (BOTTOM) ─────────────────────────────────────────────