From 741eff8c50f07b9e59bd165e7193f7220672e7a1 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Wed, 4 Mar 2026 22:56:11 +0800 Subject: [PATCH] Remove redundant switch descriptions from superuser detail screen The "Enabled"/"Disabled" summary text under each switch is redundant since the toggle state is already visually conveyed by the switch itself. Made-with: Cursor --- .../ui/superuser/SuperuserDetailScreen.kt | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt index 7b32b4967..126138386 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/superuser/SuperuserDetailScreen.kt @@ -131,26 +131,17 @@ fun SuperuserDetailScreen( if (uiState.suRestrict || item.isRestricted) { SwitchRow( title = stringResource(CoreR.string.settings_su_restrict_title), - summary = stringResource( - if (item.isRestricted) CoreR.string.enabled else CoreR.string.disabled - ), checked = item.isRestricted, onCheckedChange = { viewModel.toggleRestrict(item) } ) } SwitchRow( title = stringResource(CoreR.string.superuser_toggle_notification), - summary = stringResource( - if (item.notification) CoreR.string.enabled else CoreR.string.disabled - ), checked = item.notification, onCheckedChange = { viewModel.updateNotify(item) } ) SwitchRow( title = stringResource(CoreR.string.logs), - summary = stringResource( - if (item.logging) CoreR.string.enabled else CoreR.string.disabled - ), checked = item.logging, onCheckedChange = { viewModel.updateLogging(item) } ) @@ -188,7 +179,6 @@ fun SuperuserDetailScreen( @Composable private fun SwitchRow( title: String, - summary: String, checked: Boolean, onCheckedChange: () -> Unit, ) { @@ -198,17 +188,11 @@ private fun SwitchRow( .padding(horizontal = 16.dp, vertical = 14.dp), verticalAlignment = Alignment.CenterVertically ) { - Column(modifier = Modifier.weight(1f)) { - Text( - text = title, - style = MiuixTheme.textStyles.body1, - ) - Text( - text = summary, - style = MiuixTheme.textStyles.body2, - color = MiuixTheme.colorScheme.onSurfaceVariantSummary, - ) - } + Text( + text = title, + style = MiuixTheme.textStyles.body1, + modifier = Modifier.weight(1f), + ) Spacer(Modifier.width(16.dp)) Switch( checked = checked,