From db3be41dff690bc2e9a6d5ebee4fef99c4e47e65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E5=88=BA=E8=9E=88?= Date: Sun, 3 Nov 2024 23:53:24 +0800 Subject: [PATCH] feat: change desc --- .../kotlin/li/songe/gkd/ui/AdvancedPage.kt | 27 +++++++++++++------ .../kotlin/li/songe/gkd/ui/SlowGroupPage.kt | 4 +-- .../kotlin/li/songe/gkd/ui/SnapshotPage.kt | 4 +-- .../li/songe/gkd/ui/home/ControlPage.kt | 4 +-- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt index 81ce97d..7b62c2f 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/AdvancedPage.kt @@ -408,12 +408,15 @@ fun AdvancedPage() { color = MaterialTheme.colorScheme.primary, ) - SettingItem( - title = "快照记录" + (if (snapshotCount > 0) "-$snapshotCount" else ""), - onClick = { - navController.toDestinationsNavigator().navigate(SnapshotPageDestination) - } - ) + if (snapshotCount > 0) { + SettingItem( + title = "快照记录", + subtitle = "存在 $snapshotCount 条记录", + onClick = { + navController.toDestinationsNavigator().navigate(SnapshotPageDestination) + } + ) + } if (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) { val screenshotRunning by ScreenshotService.isRunning.collectAsState() @@ -582,8 +585,16 @@ fun AdvancedPage() { color = MaterialTheme.colorScheme.primary, ) - TextSwitch(title = "前台悬浮窗", - subtitle = "添加透明悬浮窗,关闭可能导致不点击/点击缓慢", + TextSwitch( + title = "前台悬浮窗", + subtitle = "添加透明悬浮窗", + suffix = "查看作用", + onSuffixClick = { + context.mainVm.dialogFlow.updateDialogOptions( + title = "悬浮窗作用", + text = "1.提高 GKD 前台优先级, 降低被系统杀死概率\n2.提高点击响应速度, 关闭后可能导致点击缓慢或不点击", + ) + }, checked = store.enableAbFloatWindow, onCheckedChange = { storeFlow.value = store.copy( diff --git a/app/src/main/kotlin/li/songe/gkd/ui/SlowGroupPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/SlowGroupPage.kt index b356e44..e69f786 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/SlowGroupPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/SlowGroupPage.kt @@ -68,12 +68,12 @@ fun SlowGroupPage() { ) } }, - title = { Text(text = if (ruleSummary.slowGroupCount > 0) "缓慢查询-${ruleSummary.slowGroupCount}" else "缓慢查询") }, + title = { Text(text = "缓慢查询") }, actions = { IconButton(onClick = throttle { context.mainVm.dialogFlow.updateDialogOptions( title = "缓慢查询", - text = "任意单个规则同时满足以下 3 个条件即判定为缓慢查询\n\n1. 选择器右侧无法快速查询且不是主动查询, 或内部使用<<且无法快速查询\n2. preKeys 为空\n3. matchTime 为空或大于 10s", + text = "任意单个规则同时满足以下 3 个条件即判定为缓慢查询\n\n1. 选择器右侧无法快速查询且不是主动查询, 或内部使用<<且无法快速查询\n2. preKeys 为空\n3. matchTime 为空或大于 10s\n\n缓慢查询可能导致触发缓慢或更多耗电", ) }) { Icon(Icons.Outlined.Info, contentDescription = null) diff --git a/app/src/main/kotlin/li/songe/gkd/ui/SnapshotPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/SnapshotPage.kt index 028c2fd..91f5d51 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/SnapshotPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/SnapshotPage.kt @@ -98,13 +98,13 @@ fun SnapshotPage() { ) } }, - title = { Text(text = if (snapshots.isEmpty()) "快照记录" else "快照记录-${snapshots.size}") }, + title = { Text(text = "快照记录") }, actions = { if (snapshots.isNotEmpty()) { IconButton(onClick = throttle(fn = vm.viewModelScope.launchAsFn(Dispatchers.IO) { context.mainVm.dialogFlow.waitResult( title = "删除记录", - text = "确定删除全部快照记录?", + text = "确定删除全部 ${snapshots.size} 条快照记录?", error = true, ) snapshots.forEach { s -> diff --git a/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt b/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt index a997e69..67eaeef 100644 --- a/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt +++ b/app/src/main/kotlin/li/songe/gkd/ui/home/ControlPage.kt @@ -162,8 +162,8 @@ fun useControlPage(): ScaffoldExt { if (ruleSummary.slowGroupCount > 0) { SettingItem( - title = "耗时查询-${ruleSummary.slowGroupCount}", - subtitle = "可能导致触发缓慢或更多耗电", + title = "缓慢查询", + subtitle = "存在 ${ruleSummary.slowGroupCount} 条记录", onClick = { navController.toDestinationsNavigator().navigate(SlowGroupPageDestination) }