From c4b42c764becb93ccc35da8428d560eac638c794 Mon Sep 17 00:00:00 2001 From: Sad Ellie Date: Sat, 18 Jun 2022 19:36:10 +0300 Subject: [PATCH] Fixed colors for switch and radio button --- .../unitto/screens/setttings/AlertDialogWithList.kt | 7 +------ .../java/com/sadellie/unitto/ui/theme/ColorSchemeUtils.kt | 8 ++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/com/sadellie/unitto/screens/setttings/AlertDialogWithList.kt b/app/src/main/java/com/sadellie/unitto/screens/setttings/AlertDialogWithList.kt index 9b41c6a2..b02e478a 100644 --- a/app/src/main/java/com/sadellie/unitto/screens/setttings/AlertDialogWithList.kt +++ b/app/src/main/java/com/sadellie/unitto/screens/setttings/AlertDialogWithList.kt @@ -12,7 +12,6 @@ import androidx.compose.material.ripple.rememberRipple import androidx.compose.material3.AlertDialog import androidx.compose.material3.MaterialTheme import androidx.compose.material3.RadioButton -import androidx.compose.material3.RadioButtonDefaults import androidx.compose.material3.Text import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable @@ -102,11 +101,7 @@ private fun CustomDialogContentListItem( ) { RadioButton( selected = selected, - onClick = onClick, - colors = RadioButtonDefaults.colors( - selectedColor = MaterialTheme.colorScheme.onPrimaryContainer, - unselectedColor = MaterialTheme.colorScheme.onPrimaryContainer - ) + onClick = onClick ) Text( text = label diff --git a/app/src/main/java/com/sadellie/unitto/ui/theme/ColorSchemeUtils.kt b/app/src/main/java/com/sadellie/unitto/ui/theme/ColorSchemeUtils.kt index c1eb6a2c..95d35db7 100644 --- a/app/src/main/java/com/sadellie/unitto/ui/theme/ColorSchemeUtils.kt +++ b/app/src/main/java/com/sadellie/unitto/ui/theme/ColorSchemeUtils.kt @@ -76,8 +76,8 @@ fun dynamicLightTheme(context: Context): ColorScheme { return lightColorScheme( // Settings screen group text, units screen units group text primary = primary, - // Text color on Third party Licenses screen - onPrimary = primary.shiftTo255(0.3f), + // Switch thumb color + onPrimary = primary.getAppropriateTextColor(), onPrimaryContainer = primary.shiftTo0(0.7f), // Selected unit, group, keyboard buttons secondaryContainer = secondary, @@ -132,8 +132,8 @@ fun dynamicDarkTheme(context: Context): ColorScheme { return darkColorScheme( // Settings screen group text, units screen units group text primary = primary, - // Text color on Third party Licenses screen - onPrimary = primary.shiftTo0(0.3f), + // Switch thumb color + onPrimary = primary.getAppropriateTextColor(), onPrimaryContainer = primary.shiftTo255(0.7f), // Selected unit, group, keyboard buttons secondaryContainer = secondary,