Improve font color blending and contrast in dark mode.

Fix login issue (#19).

Modify styles for more settings.

Do not show the status of susfs when using lkm mode.

Signed-off-by: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com>
This commit is contained in:
ShirkNeko
2025-03-31 13:57:05 +08:00
parent fe7ec9dcf5
commit 7f0ae95dfb
3 changed files with 30 additions and 21 deletions

View File

@@ -335,6 +335,7 @@ private fun StatusCard(
Spacer(modifier = Modifier.height(4.dp)) Spacer(modifier = Modifier.height(4.dp))
val suSFS = getSuSFS() val suSFS = getSuSFS()
if (lkmMode != true) {
val translatedStatus = when (suSFS) { val translatedStatus = when (suSFS) {
"Supported" -> stringResource(R.string.status_supported) "Supported" -> stringResource(R.string.status_supported)
"Not Supported" -> stringResource(R.string.status_not_supported) "Not Supported" -> stringResource(R.string.status_not_supported)
@@ -347,6 +348,7 @@ private fun StatusCard(
) )
} }
} }
}
kernelVersion.isGKI() -> { kernelVersion.isGKI() -> {
Icon(Icons.Outlined.Warning, stringResource(R.string.home_not_installed)) Icon(Icons.Outlined.Warning, stringResource(R.string.home_not_installed))

View File

@@ -140,7 +140,6 @@ fun SettingScreen(navigator: DestinationsNavigator) {
loadingDialog.hide() loadingDialog.hide()
snackBarHost.showSnackbar(context.getString(R.string.log_saved)) snackBarHost.showSnackbar(context.getString(R.string.log_saved))
} }
// endregion
} }
// region 配置项列表 // region 配置项列表
// 配置文件模板入口 // 配置文件模板入口
@@ -218,12 +217,12 @@ fun SettingScreen(navigator: DestinationsNavigator) {
prefs.edit { putBoolean("enable_web_debugging", it) } prefs.edit { putBoolean("enable_web_debugging", it) }
enableWebDebugging = it enableWebDebugging = it
} }
// endregion // 更多设置
val newButtonTitle = stringResource(id = R.string.more_settings) val newButtonTitle = stringResource(id = R.string.more_settings)
ListItem( ListItem(
leadingContent = { leadingContent = {
Icon( Icon(
Icons.Filled.ExpandMore, Icons.Filled.Settings,
contentDescription = newButtonTitle contentDescription = newButtonTitle
) )
}, },

View File

@@ -43,23 +43,23 @@ object ThemeConfig {
@Composable @Composable
private fun getDarkColorScheme() = darkColorScheme( private fun getDarkColorScheme() = darkColorScheme(
primary = ThemeConfig.currentTheme.Primary.copy(alpha = 0.8f), primary = ThemeConfig.currentTheme.Primary.copy(alpha = 0.8f),
onPrimary = Color.White, onPrimary = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f),
primaryContainer = ThemeConfig.currentTheme.PrimaryContainer.copy(alpha = 0.15f), primaryContainer = ThemeConfig.currentTheme.PrimaryContainer.copy(alpha = 0.15f),
onPrimaryContainer = Color.White, onPrimaryContainer = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f),
secondary = ThemeConfig.currentTheme.Secondary.copy(alpha = 0.8f), secondary = ThemeConfig.currentTheme.Secondary.copy(alpha = 0.8f),
onSecondary = Color.White, onSecondary = mixColors(ThemeConfig.currentTheme.Secondary, Color.White, 0.2f),
secondaryContainer = ThemeConfig.currentTheme.SecondaryContainer.copy(alpha = 0.15f), secondaryContainer = ThemeConfig.currentTheme.SecondaryContainer.copy(alpha = 0.15f),
onSecondaryContainer = Color.White, onSecondaryContainer = mixColors(ThemeConfig.currentTheme.Secondary, Color.White, 0.2f),
tertiary = ThemeConfig.currentTheme.Tertiary.copy(alpha = 0.8f), tertiary = ThemeConfig.currentTheme.Tertiary.copy(alpha = 0.8f),
onTertiary = Color.White, onTertiary = mixColors(ThemeConfig.currentTheme.Tertiary, Color.White, 0.2f),
tertiaryContainer = ThemeConfig.currentTheme.TertiaryContainer.copy(alpha = 0.15f), tertiaryContainer = ThemeConfig.currentTheme.TertiaryContainer.copy(alpha = 0.15f),
onTertiaryContainer = Color.White, onTertiaryContainer = mixColors(ThemeConfig.currentTheme.Tertiary, Color.White, 0.2f),
background = Color.Transparent, background = Color.Transparent,
surface = Color.Transparent, surface = Color.Transparent,
onBackground = Color.White.copy(alpha = 0.87f), onBackground = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.1f),
onSurface = Color.White.copy(alpha = 0.87f), onSurface = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.1f),
surfaceVariant = Color(0xFF2F2F2F), surfaceVariant = Color(0xFF2F2F2F),
onSurfaceVariant = Color.White.copy(alpha = 0.78f), onSurfaceVariant = mixColors(ThemeConfig.currentTheme.Primary, Color.White, 0.2f),
outline = Color.White.copy(alpha = 0.12f), outline = Color.White.copy(alpha = 0.12f),
outlineVariant = Color.White.copy(alpha = 0.12f) outlineVariant = Color.White.copy(alpha = 0.12f)
) )
@@ -340,3 +340,11 @@ private fun adjustColor(color: Color): Color {
} }
return color.copy(luminance) return color.copy(luminance)
} }
private fun mixColors(color1: Color, color2: Color, ratio: Float): Color {
val r = (color1.red * ratio + color2.red * (1 - ratio))
val g = (color1.green * ratio + color2.green * (1 - ratio))
val b = (color1.blue * ratio + color2.blue * (1 - ratio))
val a = (color1.alpha * ratio + color2.alpha * (1 - ratio))
return Color(r, g, b, a)
}