Skip to content

Commit 7ef51b7

Browse files
committed
Pre-release
1 parent 5701501 commit 7ef51b7

File tree

14 files changed

+120
-85
lines changed

14 files changed

+120
-85
lines changed

app/build.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ android {
1111
applicationId = "me.kyuubiran.qqcleaner"
1212
minSdk = 26
1313
targetSdk = 32
14-
versionCode = 66
15-
versionName = "2.0.0-beta4"
14+
versionCode = 67
15+
versionName = "2.0.0 pre-release"
1616
vectorDrawables {
1717
useSupportLibrary = true
1818
}

app/src/main/assets/qq.json

+24
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,30 @@
309309
"suffix": "/TMAssistantSDK"
310310
}
311311
]
312+
},
313+
{
314+
"title": "虚幻引擎",
315+
"enable": false,
316+
"path": [
317+
{
318+
"prefix": "!PublicDataDir",
319+
"suffix": "/files/UE4Game"
320+
}
321+
]
322+
},
323+
{
324+
"title": "超级QQ秀",
325+
"enable": false,
326+
"path": [
327+
{
328+
"prefix": "!PublicDataDir",
329+
"suffix": "/files/QQShowDownload"
330+
},
331+
{
332+
"prefix": "!PublicDataDir",
333+
"suffix": "/files/zootopia_download"
334+
}
335+
]
312336
}
313337
]
314338
}

app/src/main/java/me/kyuubiran/qqcleaner/ui/QQCleanerApp.kt

+8-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Config
1111
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Developer
1212
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Main
1313
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Sort
14-
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.SortFix
1514
import me.kyuubiran.qqcleaner.ui.scene.*
1615

1716
/**
@@ -34,13 +33,18 @@ fun QQCleanerApp() {
3433

3534
composable(Config) {
3635
ConfigScreen(navController = navController)
36+
navController.addOnDestinationChangedListener { _, destination, _ ->
37+
if (destination.route == Config) {
38+
39+
}
40+
}
3741
}
3842
composable(Sort) {
3943
SortScreen(navController = navController)
4044
}
41-
composable(SortFix) {
42-
SortFixScreen(navController = navController)
43-
}
45+
// composable(SortFix) {
46+
// SortFixScreen(navController = navController)
47+
// }
4448

4549

4650
composable(About) {

app/src/main/java/me/kyuubiran/qqcleaner/ui/composable/Switch.kt

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ fun Switch(
6969
// 通过 Boolean 反向给按钮赋值
7070
LaunchedEffect(checked.value) {
7171
swipeableState.animateTo(if (checked.value) 1 else 0)
72-
7372
}
7473

7574
// 按钮的宽高

app/src/main/java/me/kyuubiran/qqcleaner/ui/composable/dialog/ConfigAddDialog.kt

+9-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fun ConfigAddDialog(
3838
val state = remember { mutableStateOf(true) }
3939
BottomDialog(
4040
onDismissRequest = onDismissRequest,
41-
dialogHeight = if (list.isEmpty()) 408f else 352f,
41+
dialogHeight = if (list.isEmpty()) /* 408f else 352f */ 352f else 296f,
4242
dialogText = stringResource(id = dialog_title_config),
4343
state = state
4444
) {
@@ -78,13 +78,14 @@ fun ConfigAddDialog(
7878
state.value = false
7979
}
8080
)
81-
ConfigItem(
82-
id = R.drawable.ic_add,
83-
text = stringResource(id = R.string.create_config),
84-
onClick = {
85-
state.value = false
86-
}
87-
)
81+
// ConfigItem(
82+
// id = R.drawable.ic_add,
83+
// text = stringResource(id = R.string.create_config),
84+
// onClick = {
85+
// //TODO("新建配置")
86+
// state.value = false
87+
// }
88+
// )
8889
if (list.isEmpty()) {
8990
ConfigItem(
9091
id = R.drawable.ic_default,

app/src/main/java/me/kyuubiran/qqcleaner/ui/composable/dialog/ConfigDialog.kt

+10-9
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ fun ConfigDialog(
5252
EditDialog(
5353
onDismissRequest = onDismissRequest,
5454
dialogHeight = when (isDialogScreen.value) {
55-
Main -> 520f
56-
Edit -> 312f
55+
Main -> /* 520f */ 464f
56+
Edit -> /* 312f */ 256f
5757
Del -> 219f
5858
},
5959
dialogText = when (isDialogScreen.value) {
@@ -195,13 +195,14 @@ private fun ConfigUI(
195195
)
196196
}
197197
)
198-
ConfigItem(
199-
id = R.drawable.ic_edit_name,
200-
text = stringResource(id = modify_config_name),
201-
onClick = {
202-
screen.value = Edit
203-
}
204-
)
198+
// ConfigItem(
199+
// id = R.drawable.ic_edit_name,
200+
// text = stringResource(id = modify_config_name),
201+
// onClick = {
202+
// //TODO("修改配置名称、作者")
203+
// screen.value = Edit
204+
// }
205+
// )
205206
ConfigItem(
206207
id = R.drawable.ic_save,
207208
text = stringResource(id = export_this_config),

app/src/main/java/me/kyuubiran/qqcleaner/ui/composable/dialog/SortAddDialog.kt

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ import me.kyuubiran.qqcleaner.ui.util.hideKeyBoard
2020

2121
@Composable
2222
fun SortAddDialog(
23-
onDismissRequest: () -> Unit
23+
isNew: Boolean = false,
24+
onDismissRequest: () -> Unit = {},
2425
) {
2526
val state = remember { mutableStateOf(true) }
2627
val isSoftShowing = remember { mutableStateOf(true) }
2728
EditDialog(
2829
onDismissRequest = onDismissRequest,
2930
dialogHeight = 240f,
30-
dialogText = stringResource(id = R.string.dialog_title_edit_config),
31+
dialogText = stringResource(id = if (isNew) R.string.dialog_title_new_path else R.string.dialog_title_change_path_name),
3132
isSoftShowing = isSoftShowing,
3233
state = state
3334
) {
@@ -59,7 +60,7 @@ fun SortAddDialog(
5960
}
6061
false
6162
},
62-
hintText = "配置名称"
63+
hintText = stringResource(id = R.string.path_name)
6364
)
6465

6566
// 判断是否为空,为空的时候无法点击不为空的时候,可以点击

app/src/main/java/me/kyuubiran/qqcleaner/ui/composable/dialog/SortDialog.kt

+15-7
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ import androidx.compose.ui.res.stringResource
1919
import androidx.compose.ui.unit.dp
2020
import androidx.navigation.NavController
2121
import me.kyuubiran.qqcleaner.R
22+
import me.kyuubiran.qqcleaner.data.CleanData
2223
import me.kyuubiran.qqcleaner.ui.QQCleanerApp
2324
import me.kyuubiran.qqcleaner.ui.composable.EditText
2425
import me.kyuubiran.qqcleaner.ui.composable.Line
2526
import me.kyuubiran.qqcleaner.ui.composable.dialog.SortDialogScreen.*
2627
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerColorTheme.colors
2728
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerTypes
2829
import me.kyuubiran.qqcleaner.ui.util.RippleCustomTheme
30+
import me.kyuubiran.qqcleaner.ui.util.Shared
2931
import me.kyuubiran.qqcleaner.ui.util.hideKeyBoard
3032

3133
private enum class SortDialogScreen {
@@ -37,6 +39,7 @@ private enum class SortDialogScreen {
3739
@Composable
3840
fun SortDialog(
3941
navController: NavController,
42+
data: CleanData.PathData,
4043
onDismissRequest: () -> Unit
4144
) {
4245
val state = remember { mutableStateOf(true) }
@@ -50,8 +53,8 @@ fun SortDialog(
5053
Del -> 219f
5154
},
5255
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)
5558
Del -> stringResource(id = R.string.dialog_del_title)
5659
},
5760
isSoftShowing = isSoftShowing,
@@ -63,6 +66,7 @@ fun SortDialog(
6366
Main -> ConfigUI(
6467
state = state,
6568
navController = navController,
69+
data = data,
6670
screen = isDialogScreen
6771
)
6872
Edit -> EditUI(
@@ -83,7 +87,8 @@ fun SortDialog(
8387
private fun ConfigUI(
8488
state: MutableState<Boolean>,
8589
navController: NavController,
86-
screen: MutableState<SortDialogScreen>
90+
screen: MutableState<SortDialogScreen>,
91+
data: CleanData.PathData
8792
) {
8893
Column {
8994
// 线条绘制
@@ -95,8 +100,9 @@ private fun ConfigUI(
95100
)
96101
ConfigItem(
97102
id = R.drawable.ic_edit,
98-
text = stringResource(id = R.string.modify_config),
103+
text = stringResource(id = R.string.dialog_title_edit_path),
99104
onClick = {
105+
Shared.currentEditCleanPathData = data
100106
state.value = false
101107
navController.navigate(
102108
QQCleanerApp.SortFix,
@@ -105,8 +111,9 @@ private fun ConfigUI(
105111
)
106112
ConfigItem(
107113
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),
109115
onClick = {
116+
//TODO("修改路径类别名字")
110117
screen.value = Edit
111118
}
112119
)
@@ -155,7 +162,7 @@ private fun EditUI(
155162
}
156163
false
157164
},
158-
hintText = "配置名称"
165+
hintText = stringResource(id = R.string.path_name)
159166
)
160167

161168
// 判断是否为空,为空的时候无法点击不为空的时候,可以点击
@@ -182,7 +189,8 @@ private fun DelUI(
182189
end = 24.dp,
183190
bottom = 24.dp
184191
),
185-
text = "您确定要删除「」吗?",
192+
//TODO("路径名称")
193+
text = stringResource(id = R.string.confirm_delete, "config"),
186194
style = QQCleanerTypes.itemTextStyle,
187195
color = colors.secondTextColor
188196
)

app/src/main/java/me/kyuubiran/qqcleaner/ui/scene/AboutScreen.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ fun AboutScreen(navController: NavController) {
7272
color = colors.firstTextColor
7373
)
7474
Text(
75-
text = "ver.${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})",
75+
text = "Ver. ${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})",
7676
modifier = Modifier
7777
.padding(top = 18.dp)
7878
.align(Alignment.CenterHorizontally),

app/src/main/java/me/kyuubiran/qqcleaner/ui/scene/ConfigScreen.kt

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ import me.kyuubiran.qqcleaner.util.rememberMutableStateOf
3838
*/
3939
@Composable
4040
fun ConfigScreen(navController: NavController) {
41-
4241
// 配置文件列表
4342
val cfgList = remember {
44-
mutableStateListOf<CleanData>().apply {
45-
addAll(CleanManager.getAllConfigs())
46-
}
43+
mutableStateListOf(*CleanManager.getAllConfigs())
4744
}
4845

4946
// 新建配置对话框

app/src/main/java/me/kyuubiran/qqcleaner/ui/scene/SortFixScreen.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import me.kyuubiran.qqcleaner.ui.util.Shared
3333
*/
3434
@Composable
3535
fun SortFixScreen(navController: NavController) {
36-
3736
var fileDialogShow by remember { mutableStateOf(false) }
3837
if (fileDialogShow) {
3938
FileDialog {
@@ -65,8 +64,8 @@ fun SortFixScreen(navController: NavController) {
6564
titleText = Shared.currentEditCleanData.title,
6665
id = R.drawable.ic_save
6766
)
68-
// 这里判断是否为空
69-
if (true) {
67+
68+
if (Shared.currentEditCleanPathData.pathList.isNotEmpty()) {
7069
LazyColumn(
7170
modifier = Modifier
7271
.padding(top = 24.dp)
@@ -76,9 +75,9 @@ fun SortFixScreen(navController: NavController) {
7675
shape = QQCleanerShapes.cardGroupBackground
7776
)
7877
) {
79-
items(2) { item ->
78+
items(Shared.currentEditCleanPathData.pathList.size) { item ->
8079
FileItem(
81-
text = "这个是第{$item}个,啦啦啦啦啦啦",
80+
text = "这个是第${item}个,啦啦啦啦啦啦",
8281
onClick = {
8382
fileDialogShow = true
8483
}

0 commit comments

Comments
 (0)