From cca608954a6a78fc1baaca6fb1c9b7a40748312c Mon Sep 17 00:00:00 2001 From: ShirkNeko <2773800761@qq.com> Date: Sun, 23 Mar 2025 10:36:10 +0800 Subject: [PATCH] - Optimizing interface text - Use string resources instead of hardcoding --- .../zako/sukisu/ui/screen/Install.kt | 38 ++++++++----------- .../shirkneko/zako/sukisu/ui/screen/Module.kt | 4 +- .../zako/sukisu/ui/screen/SuperUser.kt | 14 +------ .../src/main/res/values-zh-rCN/strings.xml | 3 ++ manager/app/src/main/res/values/strings.xml | 3 ++ 5 files changed, 25 insertions(+), 37 deletions(-) diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Install.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Install.kt index b4b2ab0c..d6cbf449 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Install.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Install.kt @@ -508,33 +508,25 @@ fun rememberSelectKmiDialog(onSelected: (String?) -> Unit): DialogHandle { val supportedKmi by produceState(initialValue = emptyList()) { value = getSupportedKmis() } - val options = supportedKmi.map { value -> - ListOption(titleText = value) + ListOption( + titleText = value + ) } var selection by remember { mutableStateOf(null) } - - ListDialog( - state = rememberUseCaseState( - visible = true, - onFinishedRequest = { - onSelected(selection) - }, - onCloseRequest = { - dismiss() - } - ), - header = Header.Default( - title = stringResource(R.string.select_kmi), - ), - selection = ListSelection.Single( - showRadioButtons = true, - options = options, - ) { _, option -> - selection = option.titleText - } - ) + ListDialog(state = rememberUseCaseState(visible = true, onFinishedRequest = { + onSelected(selection) + }, onCloseRequest = { + dismiss() + }), header = Header.Default( + title = stringResource(R.string.select_kmi), + ), selection = ListSelection.Single( + showRadioButtons = true, + options = options, + ) { _, option -> + selection = option.titleText + }) } } diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt index 2e592e88..bb48f47f 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/Module.kt @@ -313,7 +313,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) { leadingIcon = { Icon( imageVector = Icons.Outlined.Download, - contentDescription = "备份" + contentDescription = stringResource(R.string.backup) ) }, onClick = { @@ -326,7 +326,7 @@ fun ModuleScreen(navigator: DestinationsNavigator) { leadingIcon = { Icon( imageVector = Icons.Outlined.Refresh, - contentDescription = "还原" + contentDescription = stringResource(R.string.restore) ) }, onClick = { diff --git a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/SuperUser.kt b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/SuperUser.kt index 8e21afae..0cef65bb 100644 --- a/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/SuperUser.kt +++ b/manager/app/src/main/java/shirkneko/zako/sukisu/ui/screen/SuperUser.kt @@ -106,7 +106,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { viewModel.showSystemApps = !viewModel.showSystemApps showDropdown = false }) - // 批量操作菜单项已移除 DropdownMenuItem(text = { Text(stringResource(R.string.backup_allowlist)) }, onClick = { @@ -144,7 +143,7 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { } } ) { - Text("批量授权") + Text(stringResource(R.string.batch_authorization)) } Button( @@ -154,7 +153,7 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { } } ) { - Text("批量取消授权") + Text(stringResource(R.string.batch_cancel_authorization)) } } } @@ -180,9 +179,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { // 显示ROOT权限应用组 if (rootApps.isNotEmpty()) { - item { - GroupHeader(title = "ROOT 权限应用") - } items(rootApps, key = { "root_" + it.packageName + it.uid }) { app -> AppItem( app = app, @@ -218,9 +214,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { // 显示自定义配置应用组 if (customApps.isNotEmpty()) { - item { - GroupHeader(title = "自定义配置应用") - } items(customApps, key = { "custom_" + it.packageName + it.uid }) { app -> AppItem( app = app, @@ -256,9 +249,6 @@ fun SuperUserScreen(navigator: DestinationsNavigator) { // 显示其他应用组 if (otherApps.isNotEmpty()) { - item { - GroupHeader(title = "其他应用") - } items(otherApps, key = { "other_" + it.packageName + it.uid }) { app -> AppItem( app = app, diff --git a/manager/app/src/main/res/values-zh-rCN/strings.xml b/manager/app/src/main/res/values-zh-rCN/strings.xml index 25ac8d04..48574f61 100644 --- a/manager/app/src/main/res/values-zh-rCN/strings.xml +++ b/manager/app/src/main/res/values-zh-rCN/strings.xml @@ -153,6 +153,7 @@ 备份失败:%1$s 备份模块 恢复模块 + 备份 模块已成功还原,需重启生效 还原失败:%1$s @@ -214,4 +215,6 @@ 重启失败 + 批量授权 + 批量取消授权 \ No newline at end of file diff --git a/manager/app/src/main/res/values/strings.xml b/manager/app/src/main/res/values/strings.xml index 8dadf34d..d68aa3a6 100644 --- a/manager/app/src/main/res/values/strings.xml +++ b/manager/app/src/main/res/values/strings.xml @@ -216,4 +216,7 @@ yes no Reboot Failed + bulk license + Batch cancel authorization + Backup