From 6911f24d862e9d975936001eaecdb3cd1d7aa8a4 Mon Sep 17 00:00:00 2001 From: Sasikanth Miriyampalli Date: Wed, 7 Feb 2024 14:06:40 +0530 Subject: [PATCH] Change background color of selected deletion period in dropdown menu --- .../rss/reader/settings/ui/SettingsScreen.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt index b6eaf3a38..27031a928 100644 --- a/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt +++ b/shared/src/commonMain/kotlin/dev/sasikanth/rss/reader/settings/ui/SettingsScreen.kt @@ -15,6 +15,7 @@ */ package dev.sasikanth.rss.reader.settings.ui +import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -338,17 +339,25 @@ private fun PostsDeletionPeriodSettingItem( ONE_YEAR -> LocalStrings.current.settingsPostsDeletionPeriodOneYear } + val backgroundColor = + if (period == postsDeletionPeriod) { + AppTheme.colorScheme.tintedSurface + } else { + Color.Unspecified + } + DropdownMenuItem( onClick = { onValueChanged(period) showDropdown = false - } + }, + modifier = Modifier.background(backgroundColor) ) { val textColor = if (period == postsDeletionPeriod) { - AppTheme.colorScheme.tintedForeground - } else { AppTheme.colorScheme.onSurface + } else { + AppTheme.colorScheme.textEmphasisHigh } Text(text = periodString, style = MaterialTheme.typography.bodyLarge, color = textColor)