diff --git a/app/src/main/java/app/closer/data/local/SettingsDataStore.kt b/app/src/main/java/app/closer/data/local/SettingsDataStore.kt index af8fb174..ad367d94 100644 --- a/app/src/main/java/app/closer/data/local/SettingsDataStore.kt +++ b/app/src/main/java/app/closer/data/local/SettingsDataStore.kt @@ -103,6 +103,9 @@ class SettingsDataStore @Inject constructor( dataStore.edit { it[ONBOARDING_COMPLETE] = complete }.let {} override suspend fun setThemeMode(mode: ThemeMode) = + // Persist every explicit choice, including DEVICE/System. The system theme is the + // default only on first load (when no key is stored yet → fromStorageValue → DEVICE); + // once the user picks anything we save it rather than dropping back to "no preference". dataStore.edit { it[THEME_MODE] = mode.name }.let {} override suspend fun setBiometricLogin(enabled: Boolean) = diff --git a/app/src/main/java/app/closer/ui/settings/SettingsScreen.kt b/app/src/main/java/app/closer/ui/settings/SettingsScreen.kt index 70f8b32d..30ae978d 100644 --- a/app/src/main/java/app/closer/ui/settings/SettingsScreen.kt +++ b/app/src/main/java/app/closer/ui/settings/SettingsScreen.kt @@ -2,8 +2,10 @@ package app.closer.ui.settings import androidx.compose.foundation.background import androidx.compose.foundation.border +import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.Row @@ -363,6 +365,16 @@ fun SettingsScreen( } // Partner card — fully tappable, visually obvious + val partnerCardColor = if (state.isPaired) { + SettingsSoft.copy(alpha = 0.52f) + } else if (isCloserDarkTheme()) { + MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.74f) + } else { + MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.46f) + } + val partnerAccent = if (state.isPaired) SettingsPrimaryDeep else MaterialTheme.colorScheme.secondary + val partnerContentColor = if (state.isPaired) SettingsInk else MaterialTheme.colorScheme.onSecondaryContainer + val partnerMutedColor = if (state.isPaired) SettingsMuted else MaterialTheme.colorScheme.onSecondaryContainer.copy(alpha = 0.72f) Card( onClick = { onNavigate( @@ -372,7 +384,8 @@ fun SettingsScreen( }, modifier = Modifier.fillMaxWidth(), shape = RoundedCornerShape(22.dp), - colors = CardDefaults.cardColors(containerColor = SettingsSoft.copy(alpha = 0.52f)), + colors = CardDefaults.cardColors(containerColor = partnerCardColor), + border = if (state.isPaired) null else BorderStroke(1.dp, partnerAccent.copy(alpha = 0.18f)), elevation = CardDefaults.cardElevation(defaultElevation = 5.dp) ) { Row( @@ -382,11 +395,28 @@ fun SettingsScreen( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp) ) { - ProfileAvatar( - imageUrl = state.partnerPhotoUrl, - fallbackIcon = if (state.isPaired) Icons.Filled.Favorite else Icons.Filled.FavoriteBorder, - fallbackTint = if (state.isPaired) SettingsPrimaryDeep else SettingsMuted - ) + if (state.isPaired) { + ProfileAvatar( + imageUrl = state.partnerPhotoUrl, + fallbackIcon = Icons.Filled.Favorite, + fallbackTint = SettingsPrimaryDeep + ) + } else { + Box( + modifier = Modifier + .size(48.dp) + .clip(RoundedCornerShape(16.dp)) + .background(partnerAccent.copy(alpha = 0.13f)), + contentAlignment = Alignment.Center + ) { + Icon( + Icons.Filled.FavoriteBorder, + contentDescription = null, + tint = partnerAccent, + modifier = Modifier.size(24.dp) + ) + } + } Column( modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp) @@ -394,7 +424,7 @@ fun SettingsScreen( Text( text = if (state.isPaired) "Connected with" else "No partner yet", style = MaterialTheme.typography.labelMedium, - color = SettingsMuted, + color = partnerMutedColor, maxLines = 1, overflow = TextOverflow.Ellipsis ) @@ -403,15 +433,16 @@ fun SettingsScreen( text = state.partnerName ?: "Your partner", style = MaterialTheme.typography.titleMedium, fontWeight = FontWeight.SemiBold, - color = SettingsInk, + color = partnerContentColor, maxLines = 1, overflow = TextOverflow.Ellipsis ) } else { Text( text = "Invite someone to connect", - style = MaterialTheme.typography.bodyMedium, - color = SettingsInk, + style = MaterialTheme.typography.titleSmall, + fontWeight = FontWeight.SemiBold, + color = partnerContentColor, maxLines = 1, overflow = TextOverflow.Ellipsis ) @@ -421,7 +452,7 @@ fun SettingsScreen( Icons.AutoMirrored.Filled.ArrowForwardIos, contentDescription = null, modifier = Modifier.size(16.dp), - tint = SettingsPrimaryDeep + tint = partnerAccent ) } }