Skip to content

Commit

Permalink
Pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
KyuubiRan committed Feb 28, 2022
1 parent 5701501 commit 7ef51b7
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 85 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId = "me.kyuubiran.qqcleaner"
minSdk = 26
targetSdk = 32
versionCode = 66
versionName = "2.0.0-beta4"
versionCode = 67
versionName = "2.0.0 pre-release"
vectorDrawables {
useSupportLibrary = true
}
Expand Down
24 changes: 24 additions & 0 deletions app/src/main/assets/qq.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,30 @@
"suffix": "/TMAssistantSDK"
}
]
},
{
"title": "虚幻引擎",
"enable": false,
"path": [
{
"prefix": "!PublicDataDir",
"suffix": "/files/UE4Game"
}
]
},
{
"title": "超级QQ秀",
"enable": false,
"path": [
{
"prefix": "!PublicDataDir",
"suffix": "/files/QQShowDownload"
},
{
"prefix": "!PublicDataDir",
"suffix": "/files/zootopia_download"
}
]
}
]
}
12 changes: 8 additions & 4 deletions app/src/main/java/me/kyuubiran/qqcleaner/ui/QQCleanerApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Config
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Developer
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Main
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.Sort
import me.kyuubiran.qqcleaner.ui.QQCleanerApp.SortFix
import me.kyuubiran.qqcleaner.ui.scene.*

/**
Expand All @@ -34,13 +33,18 @@ fun QQCleanerApp() {

composable(Config) {
ConfigScreen(navController = navController)
navController.addOnDestinationChangedListener { _, destination, _ ->
if (destination.route == Config) {

}
}
}
composable(Sort) {
SortScreen(navController = navController)
}
composable(SortFix) {
SortFixScreen(navController = navController)
}
// composable(SortFix) {
// SortFixScreen(navController = navController)
// }


composable(About) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ fun Switch(
// 通过 Boolean 反向给按钮赋值
LaunchedEffect(checked.value) {
swipeableState.animateTo(if (checked.value) 1 else 0)

}

// 按钮的宽高
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun ConfigAddDialog(
val state = remember { mutableStateOf(true) }
BottomDialog(
onDismissRequest = onDismissRequest,
dialogHeight = if (list.isEmpty()) 408f else 352f,
dialogHeight = if (list.isEmpty()) /* 408f else 352f */ 352f else 296f,
dialogText = stringResource(id = dialog_title_config),
state = state
) {
Expand Down Expand Up @@ -78,13 +78,14 @@ fun ConfigAddDialog(
state.value = false
}
)
ConfigItem(
id = R.drawable.ic_add,
text = stringResource(id = R.string.create_config),
onClick = {
state.value = false
}
)
// ConfigItem(
// id = R.drawable.ic_add,
// text = stringResource(id = R.string.create_config),
// onClick = {
// //TODO("新建配置")
// state.value = false
// }
// )
if (list.isEmpty()) {
ConfigItem(
id = R.drawable.ic_default,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ fun ConfigDialog(
EditDialog(
onDismissRequest = onDismissRequest,
dialogHeight = when (isDialogScreen.value) {
Main -> 520f
Edit -> 312f
Main -> /* 520f */ 464f
Edit -> /* 312f */ 256f
Del -> 219f
},
dialogText = when (isDialogScreen.value) {
Expand Down Expand Up @@ -195,13 +195,14 @@ private fun ConfigUI(
)
}
)
ConfigItem(
id = R.drawable.ic_edit_name,
text = stringResource(id = modify_config_name),
onClick = {
screen.value = Edit
}
)
// ConfigItem(
// id = R.drawable.ic_edit_name,
// text = stringResource(id = modify_config_name),
// onClick = {
// //TODO("修改配置名称、作者")
// screen.value = Edit
// }
// )
ConfigItem(
id = R.drawable.ic_save,
text = stringResource(id = export_this_config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import me.kyuubiran.qqcleaner.ui.util.hideKeyBoard

@Composable
fun SortAddDialog(
onDismissRequest: () -> Unit
isNew: Boolean = false,
onDismissRequest: () -> Unit = {},
) {
val state = remember { mutableStateOf(true) }
val isSoftShowing = remember { mutableStateOf(true) }
EditDialog(
onDismissRequest = onDismissRequest,
dialogHeight = 240f,
dialogText = stringResource(id = R.string.dialog_title_edit_config),
dialogText = stringResource(id = if (isNew) R.string.dialog_title_new_path else R.string.dialog_title_change_path_name),
isSoftShowing = isSoftShowing,
state = state
) {
Expand Down Expand Up @@ -59,7 +60,7 @@ fun SortAddDialog(
}
false
},
hintText = "配置名称"
hintText = stringResource(id = R.string.path_name)
)

// 判断是否为空,为空的时候无法点击不为空的时候,可以点击
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import me.kyuubiran.qqcleaner.R
import me.kyuubiran.qqcleaner.data.CleanData
import me.kyuubiran.qqcleaner.ui.QQCleanerApp
import me.kyuubiran.qqcleaner.ui.composable.EditText
import me.kyuubiran.qqcleaner.ui.composable.Line
import me.kyuubiran.qqcleaner.ui.composable.dialog.SortDialogScreen.*
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerColorTheme.colors
import me.kyuubiran.qqcleaner.ui.theme.QQCleanerTypes
import me.kyuubiran.qqcleaner.ui.util.RippleCustomTheme
import me.kyuubiran.qqcleaner.ui.util.Shared
import me.kyuubiran.qqcleaner.ui.util.hideKeyBoard

private enum class SortDialogScreen {
Expand All @@ -37,6 +39,7 @@ private enum class SortDialogScreen {
@Composable
fun SortDialog(
navController: NavController,
data: CleanData.PathData,
onDismissRequest: () -> Unit
) {
val state = remember { mutableStateOf(true) }
Expand All @@ -50,8 +53,8 @@ fun SortDialog(
Del -> 219f
},
dialogText = when (isDialogScreen.value) {
Main -> "名字"
Edit -> stringResource(id = R.string.dialog_title_edit_config)
Main -> data.title
Edit -> stringResource(id = R.string.dialog_title_edit_path)
Del -> stringResource(id = R.string.dialog_del_title)
},
isSoftShowing = isSoftShowing,
Expand All @@ -63,6 +66,7 @@ fun SortDialog(
Main -> ConfigUI(
state = state,
navController = navController,
data = data,
screen = isDialogScreen
)
Edit -> EditUI(
Expand All @@ -83,7 +87,8 @@ fun SortDialog(
private fun ConfigUI(
state: MutableState<Boolean>,
navController: NavController,
screen: MutableState<SortDialogScreen>
screen: MutableState<SortDialogScreen>,
data: CleanData.PathData
) {
Column {
// 线条绘制
Expand All @@ -95,8 +100,9 @@ private fun ConfigUI(
)
ConfigItem(
id = R.drawable.ic_edit,
text = stringResource(id = R.string.modify_config),
text = stringResource(id = R.string.dialog_title_edit_path),
onClick = {
Shared.currentEditCleanPathData = data
state.value = false
navController.navigate(
QQCleanerApp.SortFix,
Expand All @@ -105,8 +111,9 @@ private fun ConfigUI(
)
ConfigItem(
id = R.drawable.ic_edit_name,
text = stringResource(id = R.string.modify_config_name),
text = stringResource(id = R.string.dialog_title_change_path_name),
onClick = {
//TODO("修改路径类别名字")
screen.value = Edit
}
)
Expand Down Expand Up @@ -155,7 +162,7 @@ private fun EditUI(
}
false
},
hintText = "配置名称"
hintText = stringResource(id = R.string.path_name)
)

// 判断是否为空,为空的时候无法点击不为空的时候,可以点击
Expand All @@ -182,7 +189,8 @@ private fun DelUI(
end = 24.dp,
bottom = 24.dp
),
text = "您确定要删除「」吗?",
//TODO("路径名称")
text = stringResource(id = R.string.confirm_delete, "config"),
style = QQCleanerTypes.itemTextStyle,
color = colors.secondTextColor
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun AboutScreen(navController: NavController) {
color = colors.firstTextColor
)
Text(
text = "ver.${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})",
text = "Ver. ${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})",
modifier = Modifier
.padding(top = 18.dp)
.align(Alignment.CenterHorizontally),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ import me.kyuubiran.qqcleaner.util.rememberMutableStateOf
*/
@Composable
fun ConfigScreen(navController: NavController) {

// 配置文件列表
val cfgList = remember {
mutableStateListOf<CleanData>().apply {
addAll(CleanManager.getAllConfigs())
}
mutableStateListOf(*CleanManager.getAllConfigs())
}

// 新建配置对话框
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import me.kyuubiran.qqcleaner.ui.util.Shared
*/
@Composable
fun SortFixScreen(navController: NavController) {

var fileDialogShow by remember { mutableStateOf(false) }
if (fileDialogShow) {
FileDialog {
Expand Down Expand Up @@ -65,8 +64,8 @@ fun SortFixScreen(navController: NavController) {
titleText = Shared.currentEditCleanData.title,
id = R.drawable.ic_save
)
// 这里判断是否为空
if (true) {

if (Shared.currentEditCleanPathData.pathList.isNotEmpty()) {
LazyColumn(
modifier = Modifier
.padding(top = 24.dp)
Expand All @@ -76,9 +75,9 @@ fun SortFixScreen(navController: NavController) {
shape = QQCleanerShapes.cardGroupBackground
)
) {
items(2) { item ->
items(Shared.currentEditCleanPathData.pathList.size) { item ->
FileItem(
text = "这个是第{$item}个,啦啦啦啦啦啦",
text = "这个是第${item}个,啦啦啦啦啦啦",
onClick = {
fileDialogShow = true
}
Expand Down
Loading

0 comments on commit 7ef51b7

Please sign in to comment.