Optimize icon handling for settings cards

Allow icons to be optional and remove redundant group title displays
This commit is contained in:
ShirkNeko
2025-06-01 21:24:21 +08:00
parent 8a6116b4ec
commit 2817583e3c
2 changed files with 12 additions and 25 deletions

View File

@@ -510,7 +510,6 @@ fun MoreSettingsScreen() {
// 外观设置部分
SettingsCard(
title = stringResource(R.string.appearance_settings),
icon = Icons.Default.Palette
) {
// 语言设置
SettingItem(
@@ -846,8 +845,7 @@ fun MoreSettingsScreen() {
// 自定义设置部分
SettingsCard(
title = stringResource(R.string.custom_settings),
icon = Icons.Default.Settings
title = stringResource(R.string.custom_settings)
) {
// 添加简洁模式开关
SwitchItem(
@@ -914,8 +912,7 @@ fun MoreSettingsScreen() {
// 高级设置部分
SettingsCard(
title = stringResource(R.string.advanced_settings),
icon = Icons.Default.AdminPanelSettings
title = stringResource(R.string.advanced_settings)
) {
// SELinux 开关
KsuIsValid {
@@ -1164,7 +1161,7 @@ fun MoreSettingsScreen() {
@Composable
fun SettingsCard(
title: String,
icon: ImageVector,
icon: ImageVector? = null,
content: @Composable () -> Unit
) {
Card(
@@ -1180,6 +1177,7 @@ fun SettingsCard(
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp)
) {
if (icon != null) {
Icon(
imageVector = icon,
contentDescription = null,
@@ -1187,6 +1185,7 @@ fun SettingsCard(
modifier = Modifier.size(24.dp)
)
Spacer(modifier = Modifier.width(12.dp))
}
Text(
text = title,
style = MaterialTheme.typography.titleLarge,

View File

@@ -493,10 +493,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
// 显示ROOT权限应用组
if (rootApps.isNotEmpty()) {
item {
GroupHeader(title = stringResource(R.string.apps_with_root))
}
items(rootApps, key = { "root_" + it.packageName + it.uid }) { app ->
AppItem(
app = app,
@@ -532,10 +528,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
// 显示自定义配置应用组
if (customApps.isNotEmpty()) {
item {
GroupHeader(title = stringResource(R.string.apps_with_custom_profile))
}
items(customApps, key = { "custom_" + it.packageName + it.uid }) { app ->
AppItem(
app = app,
@@ -571,10 +563,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
// 显示其他应用组
if (otherApps.isNotEmpty()) {
item {
GroupHeader(title = stringResource(R.string.other_apps))
}
items(otherApps, key = { "other_" + it.packageName + it.uid }) { app ->
AppItem(
app = app,