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:
@@ -335,16 +335,18 @@ private fun StatusCard(
|
|||||||
Spacer(modifier = Modifier.height(4.dp))
|
Spacer(modifier = Modifier.height(4.dp))
|
||||||
|
|
||||||
val suSFS = getSuSFS()
|
val suSFS = getSuSFS()
|
||||||
val translatedStatus = when (suSFS) {
|
if (lkmMode != true) {
|
||||||
"Supported" -> stringResource(R.string.status_supported)
|
val translatedStatus = when (suSFS) {
|
||||||
"Not Supported" -> stringResource(R.string.status_not_supported)
|
"Supported" -> stringResource(R.string.status_supported)
|
||||||
else -> stringResource(R.string.status_unknown)
|
"Not Supported" -> stringResource(R.string.status_not_supported)
|
||||||
}
|
else -> stringResource(R.string.status_unknown)
|
||||||
|
}
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(R.string.home_susfs, translatedStatus),
|
text = stringResource(R.string.home_susfs, translatedStatus),
|
||||||
style = MaterialTheme.typography.bodyMedium
|
style = MaterialTheme.typography.bodyMedium
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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)
|
||||||
)
|
)
|
||||||
@@ -339,4 +339,12 @@ private fun adjustColor(color: Color): Color {
|
|||||||
luminance = maxLuminance
|
luminance = maxLuminance
|
||||||
}
|
}
|
||||||
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)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user