From e18a3df8e5fff94ce6371bba6246777b2ecd5233 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 27 Oct 2026 13:32:33 +0000 Subject: [PATCH] Settings' menu as cards: an icon tile, the title in the accent colour Each page a rounded card on the raised surface, its icon on a tile of the background's colour, the title in the primary colour with what it's set to beneath, the cards spaced apart; a Settings title over them, as each page has its own. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0172Hejd12i4aYikYW9vgpZs --- .../neodesktop/dmodem/ui/SettingsScreen.kt | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/neodesktop/dmodem/ui/SettingsScreen.kt b/app/src/main/java/com/neodesktop/dmodem/ui/SettingsScreen.kt index fcca46a..e7fe83c 100644 --- a/app/src/main/java/com/neodesktop/dmodem/ui/SettingsScreen.kt +++ b/app/src/main/java/com/neodesktop/dmodem/ui/SettingsScreen.kt @@ -13,6 +13,9 @@ import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.heightIn +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.background import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items @@ -278,18 +281,43 @@ private fun SettingsMenu(modifier: Modifier, s: ModemSettings, unsaved: Boolean) SettingsPage.SSH to "This phone's keys for SSH", SettingsPage.LINUX to "Linux on the phone, the modem at /dev/ttyDM0", ) - Column(modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(vertical = 8.dp)) { - for ((page, summary) in rows) { - Row( - Modifier.fillMaxWidth().clickable { SettingsNav.open(page) }.padding(horizontal = 16.dp, vertical = 12.dp), - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.spacedBy(16.dp), + Column( + modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(horizontal = 16.dp, vertical = 8.dp), + verticalArrangement = Arrangement.spacedBy(12.dp), + ) { + // (the title, as each page has its own) + Text( + "Settings", style = MaterialTheme.typography.titleLarge, + modifier = Modifier.heightIn(min = 48.dp).padding(start = 4.dp).wrapContentHeight(Alignment.CenterVertically), + ) + for ((page, summary) in rows) SettingsCard(page, summary) + } +} + +/** a page's card in the menu: its icon on a tile, its title, what it's set to; opens it */ +@Composable +private fun SettingsCard(page: SettingsPage, summary: String) { + val colors = MaterialTheme.colorScheme + androidx.compose.material3.Surface( + onClick = { SettingsNav.open(page) }, + shape = androidx.compose.foundation.shape.RoundedCornerShape(24.dp), + color = colors.surfaceContainer, + modifier = Modifier.fillMaxWidth(), + ) { + Row( + Modifier.padding(12.dp), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.spacedBy(16.dp), + ) { + androidx.compose.foundation.layout.Box( + Modifier.size(56.dp).background(colors.surface, androidx.compose.foundation.shape.RoundedCornerShape(16.dp)), + contentAlignment = Alignment.Center, ) { - androidx.compose.material3.Icon(page.icon, contentDescription = null, tint = MaterialTheme.colorScheme.primary) - Column(Modifier.weight(1f)) { - Text(page.title, style = MaterialTheme.typography.titleMedium) - Text(summary, style = MaterialTheme.typography.bodyMedium, color = MaterialTheme.colorScheme.onSurfaceVariant) - } + androidx.compose.material3.Icon(page.icon, contentDescription = null, tint = colors.primary) + } + Column(Modifier.weight(1f).padding(end = 4.dp)) { + Text(page.title, style = MaterialTheme.typography.titleMedium, color = colors.primary) + Text(summary, style = MaterialTheme.typography.bodyMedium, color = colors.onSurface) } } }