Modify UI layout

- Adjust the maximum number of SwitchItem rows to optimize the layout and spacing of interface buttons
This commit is contained in:
ShirkNeko
2025-05-11 23:30:48 +08:00
parent 59e3675a36
commit 2eeddcfa80
5 changed files with 11 additions and 18 deletions

View File

@@ -70,7 +70,7 @@ fun SwitchItem(
text = it,
style = MaterialTheme.typography.bodyMedium,
color = MaterialTheme.colorScheme.onSurfaceVariant,
maxLines = 3,
maxLines = Int.MAX_VALUE,
overflow = TextOverflow.Ellipsis
)
}

View File

@@ -110,7 +110,7 @@ fun SettingScreen(navigator: DestinationsNavigator) {
}
}
// 设置分组卡片 - 配置
// 配置
Card(
modifier = Modifier
.fillMaxWidth()

View File

@@ -166,7 +166,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
snackbarHost = { SnackbarHost(snackBarHostState) },
contentWindowInsets = WindowInsets.safeDrawing.only(WindowInsetsSides.Top + WindowInsetsSides.Horizontal),
bottomBar = {
// 批量操作按钮,直接放在底部栏
AnimatedVisibility(
visible = viewModel.showBatchActions && viewModel.selectedApps.isNotEmpty(),
enter = slideInVertically(initialOffsetY = { it }),
@@ -181,15 +180,13 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp)
horizontalArrangement = Arrangement.SpaceEvenly
) {
OutlinedButton(
onClick = {
// 修改为重新赋值为空集合
viewModel.selectedApps = emptySet()
viewModel.showBatchActions = false
},
modifier = Modifier.weight(1f),
colors = ButtonDefaults.outlinedButtonColors(
contentColor = MaterialTheme.colorScheme.primary
)
@@ -197,9 +194,9 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
Icon(
imageVector = Icons.Filled.Close,
contentDescription = null,
modifier = Modifier.size(18.dp)
modifier = Modifier.size(16.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Spacer(modifier = Modifier.width(6.dp))
Text(stringResource(android.R.string.cancel))
}
@@ -209,7 +206,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
viewModel.updateBatchPermissions(true)
}
},
modifier = Modifier.weight(1f),
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.primary
)
@@ -217,9 +213,9 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
Icon(
imageVector = Icons.Filled.Check,
contentDescription = null,
modifier = Modifier.size(18.dp)
modifier = Modifier.size(16.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Spacer(modifier = Modifier.width(6.dp))
Text(stringResource(R.string.batch_authorization))
}
@@ -229,7 +225,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
viewModel.updateBatchPermissions(false)
}
},
modifier = Modifier.weight(1f),
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.error
)
@@ -237,9 +232,9 @@ fun SuperUserScreen(navigator: DestinationsNavigator) {
Icon(
imageVector = Icons.Filled.Block,
contentDescription = null,
modifier = Modifier.size(18.dp)
modifier = Modifier.size(16.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Spacer(modifier = Modifier.width(6.dp))
Text(stringResource(R.string.batch_cancel_authorization))
}
}

View File

@@ -225,7 +225,6 @@
<string name="batch_authorization">授权</string>
<string name="batch_cancel_authorization">撤销</string>
<string name="color_yellow">黄色</string>
<string name="kpm">内核模块</string>
<string name="kpm_title">内核模块</string>
<string name="kpm_empty">暂无已安装的内核模块</string>
<string name="kpm_version">版本</string>

View File

@@ -222,12 +222,11 @@
<string name="yes">Yes</string>
<string name="no">No</string>
<string name="failed_reboot">Reboot Failed</string>
<string name="batch_authorization">authorizations</string>
<string name="batch_authorization">empower</string>
<string name="batch_cancel_authorization">withdraw</string>
<string name="backup">Backup</string>
<string name="color_yellow">Yellow</string>
<string name="kpm">KPM</string>
<string name="kpm_title">Kernel Module</string>
<string name="kpm_title">KPM</string>
<string name="kpm_empty">No installed kernel modules at this time</string>
<string name="kpm_version">Version</string>
<string name="kpm_author">Author</string>