@@ -19,13 +19,15 @@ import androidx.compose.ui.res.stringResource
19
19
import androidx.compose.ui.unit.dp
20
20
import androidx.navigation.NavController
21
21
import me.kyuubiran.qqcleaner.R
22
+ import me.kyuubiran.qqcleaner.data.CleanData
22
23
import me.kyuubiran.qqcleaner.ui.QQCleanerApp
23
24
import me.kyuubiran.qqcleaner.ui.composable.EditText
24
25
import me.kyuubiran.qqcleaner.ui.composable.Line
25
26
import me.kyuubiran.qqcleaner.ui.composable.dialog.SortDialogScreen.*
26
27
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerColorTheme.colors
27
28
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerTypes
28
29
import me.kyuubiran.qqcleaner.ui.util.RippleCustomTheme
30
+ import me.kyuubiran.qqcleaner.ui.util.Shared
29
31
import me.kyuubiran.qqcleaner.ui.util.hideKeyBoard
30
32
31
33
private enum class SortDialogScreen {
@@ -37,6 +39,7 @@ private enum class SortDialogScreen {
37
39
@Composable
38
40
fun SortDialog (
39
41
navController : NavController ,
42
+ data : CleanData .PathData ,
40
43
onDismissRequest : () -> Unit
41
44
) {
42
45
val state = remember { mutableStateOf(true ) }
@@ -50,8 +53,8 @@ fun SortDialog(
50
53
Del -> 219f
51
54
},
52
55
dialogText = when (isDialogScreen.value) {
53
- Main -> " 名字 "
54
- Edit -> stringResource(id = R .string.dialog_title_edit_config )
56
+ Main -> data.title
57
+ Edit -> stringResource(id = R .string.dialog_title_edit_path )
55
58
Del -> stringResource(id = R .string.dialog_del_title)
56
59
},
57
60
isSoftShowing = isSoftShowing,
@@ -63,6 +66,7 @@ fun SortDialog(
63
66
Main -> ConfigUI (
64
67
state = state,
65
68
navController = navController,
69
+ data = data,
66
70
screen = isDialogScreen
67
71
)
68
72
Edit -> EditUI (
@@ -83,7 +87,8 @@ fun SortDialog(
83
87
private fun ConfigUI (
84
88
state : MutableState <Boolean >,
85
89
navController : NavController ,
86
- screen : MutableState <SortDialogScreen >
90
+ screen : MutableState <SortDialogScreen >,
91
+ data : CleanData .PathData
87
92
) {
88
93
Column {
89
94
// 线条绘制
@@ -95,8 +100,9 @@ private fun ConfigUI(
95
100
)
96
101
ConfigItem (
97
102
id = R .drawable.ic_edit,
98
- text = stringResource(id = R .string.modify_config ),
103
+ text = stringResource(id = R .string.dialog_title_edit_path ),
99
104
onClick = {
105
+ Shared .currentEditCleanPathData = data
100
106
state.value = false
101
107
navController.navigate(
102
108
QQCleanerApp .SortFix ,
@@ -105,8 +111,9 @@ private fun ConfigUI(
105
111
)
106
112
ConfigItem (
107
113
id = R .drawable.ic_edit_name,
108
- text = stringResource(id = R .string.modify_config_name ),
114
+ text = stringResource(id = R .string.dialog_title_change_path_name ),
109
115
onClick = {
116
+ // TODO("修改路径类别名字")
110
117
screen.value = Edit
111
118
}
112
119
)
@@ -155,7 +162,7 @@ private fun EditUI(
155
162
}
156
163
false
157
164
},
158
- hintText = " 配置名称 "
165
+ hintText = stringResource(id = R .string.path_name)
159
166
)
160
167
161
168
// 判断是否为空,为空的时候无法点击不为空的时候,可以点击
@@ -182,7 +189,8 @@ private fun DelUI(
182
189
end = 24 .dp,
183
190
bottom = 24 .dp
184
191
),
185
- text = " 您确定要删除「」吗?" ,
192
+ // TODO("路径名称")
193
+ text = stringResource(id = R .string.confirm_delete, " config" ),
186
194
style = QQCleanerTypes .itemTextStyle,
187
195
color = colors.secondTextColor
188
196
)
0 commit comments