Optimize icon handling for settings cards
Allow icons to be optional and remove redundant group title displays
This commit is contained in:
@@ -510,7 +510,6 @@ fun MoreSettingsScreen() {
|
|||||||
// 外观设置部分
|
// 外观设置部分
|
||||||
SettingsCard(
|
SettingsCard(
|
||||||
title = stringResource(R.string.appearance_settings),
|
title = stringResource(R.string.appearance_settings),
|
||||||
icon = Icons.Default.Palette
|
|
||||||
) {
|
) {
|
||||||
// 语言设置
|
// 语言设置
|
||||||
SettingItem(
|
SettingItem(
|
||||||
@@ -846,8 +845,7 @@ fun MoreSettingsScreen() {
|
|||||||
|
|
||||||
// 自定义设置部分
|
// 自定义设置部分
|
||||||
SettingsCard(
|
SettingsCard(
|
||||||
title = stringResource(R.string.custom_settings),
|
title = stringResource(R.string.custom_settings)
|
||||||
icon = Icons.Default.Settings
|
|
||||||
) {
|
) {
|
||||||
// 添加简洁模式开关
|
// 添加简洁模式开关
|
||||||
SwitchItem(
|
SwitchItem(
|
||||||
@@ -914,8 +912,7 @@ fun MoreSettingsScreen() {
|
|||||||
|
|
||||||
// 高级设置部分
|
// 高级设置部分
|
||||||
SettingsCard(
|
SettingsCard(
|
||||||
title = stringResource(R.string.advanced_settings),
|
title = stringResource(R.string.advanced_settings)
|
||||||
icon = Icons.Default.AdminPanelSettings
|
|
||||||
) {
|
) {
|
||||||
// SELinux 开关
|
// SELinux 开关
|
||||||
KsuIsValid {
|
KsuIsValid {
|
||||||
@@ -1164,7 +1161,7 @@ fun MoreSettingsScreen() {
|
|||||||
@Composable
|
@Composable
|
||||||
fun SettingsCard(
|
fun SettingsCard(
|
||||||
title: String,
|
title: String,
|
||||||
icon: ImageVector,
|
icon: ImageVector? = null,
|
||||||
content: @Composable () -> Unit
|
content: @Composable () -> Unit
|
||||||
) {
|
) {
|
||||||
Card(
|
Card(
|
||||||
@@ -1180,13 +1177,15 @@ fun SettingsCard(
|
|||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp)
|
modifier = Modifier.padding(horizontal = 16.dp, vertical = 12.dp)
|
||||||
) {
|
) {
|
||||||
Icon(
|
if (icon != null) {
|
||||||
imageVector = icon,
|
Icon(
|
||||||
contentDescription = null,
|
imageVector = icon,
|
||||||
tint = MaterialTheme.colorScheme.primary,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(24.dp)
|
tint = MaterialTheme.colorScheme.primary,
|
||||||
)
|
modifier = Modifier.size(24.dp)
|
||||||
Spacer(modifier = Modifier.width(12.dp))
|
)
|
||||||
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
|
}
|
||||||
Text(
|
Text(
|
||||||
text = title,
|
text = title,
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
|
|||||||
@@ -493,10 +493,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
|
|||||||
|
|
||||||
// 显示ROOT权限应用组
|
// 显示ROOT权限应用组
|
||||||
if (rootApps.isNotEmpty()) {
|
if (rootApps.isNotEmpty()) {
|
||||||
item {
|
|
||||||
GroupHeader(title = stringResource(R.string.apps_with_root))
|
|
||||||
}
|
|
||||||
|
|
||||||
items(rootApps, key = { "root_" + it.packageName + it.uid }) { app ->
|
items(rootApps, key = { "root_" + it.packageName + it.uid }) { app ->
|
||||||
AppItem(
|
AppItem(
|
||||||
app = app,
|
app = app,
|
||||||
@@ -532,10 +528,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
|
|||||||
|
|
||||||
// 显示自定义配置应用组
|
// 显示自定义配置应用组
|
||||||
if (customApps.isNotEmpty()) {
|
if (customApps.isNotEmpty()) {
|
||||||
item {
|
|
||||||
GroupHeader(title = stringResource(R.string.apps_with_custom_profile))
|
|
||||||
}
|
|
||||||
|
|
||||||
items(customApps, key = { "custom_" + it.packageName + it.uid }) { app ->
|
items(customApps, key = { "custom_" + it.packageName + it.uid }) { app ->
|
||||||
AppItem(
|
AppItem(
|
||||||
app = app,
|
app = app,
|
||||||
@@ -571,10 +563,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
|
|||||||
|
|
||||||
// 显示其他应用组
|
// 显示其他应用组
|
||||||
if (otherApps.isNotEmpty()) {
|
if (otherApps.isNotEmpty()) {
|
||||||
item {
|
|
||||||
GroupHeader(title = stringResource(R.string.other_apps))
|
|
||||||
}
|
|
||||||
|
|
||||||
items(otherApps, key = { "other_" + it.packageName + it.uid }) { app ->
|
items(otherApps, key = { "other_" + it.packageName + it.uid }) { app ->
|
||||||
AppItem(
|
AppItem(
|
||||||
app = app,
|
app = app,
|
||||||
|
|||||||
Reference in New Issue
Block a user