diff --git a/app/src/main/java/me/teble/xposed/autodaily/activity/base/XaActivity.kt b/app/src/main/java/me/teble/xposed/autodaily/activity/base/XaActivity.kt index 32310151..f631a775 100644 --- a/app/src/main/java/me/teble/xposed/autodaily/activity/base/XaActivity.kt +++ b/app/src/main/java/me/teble/xposed/autodaily/activity/base/XaActivity.kt @@ -8,7 +8,6 @@ import android.os.Bundle import android.os.Handler import android.os.Looper import android.text.TextUtils -import android.util.Log import androidx.activity.OnBackPressedDispatcher import androidx.activity.OnBackPressedDispatcherOwner import androidx.activity.contextaware.ContextAware @@ -137,7 +136,6 @@ open class XaActivity : Activity(), input: I, options: ActivityOptionsCompat? ) { - Log.d(TAG, "------------onLaunch: $requestCode") val activity: Activity = this@XaActivity // Immediate result path @@ -215,7 +213,6 @@ open class XaActivity : Activity(), registry: ActivityResultRegistry, callback: ActivityResultCallback ): ActivityResultLauncher { - Log.d("XALog", "registerForActivityResult ---- 1") return registry.register( "activity_rq#${mNextLocalRequestCode.getAndIncrement()}", this, contract, callback @@ -226,7 +223,6 @@ open class XaActivity : Activity(), contract: ActivityResultContract, callback: ActivityResultCallback ): ActivityResultLauncher { - Log.d("XALog", "registerForActivityResult ---- 2") return registerForActivityResult(contract, mActivityResultRegistry, callback) } diff --git a/app/src/main/java/me/teble/xposed/autodaily/ui/MainLayout.kt b/app/src/main/java/me/teble/xposed/autodaily/ui/MainLayout.kt index a2be0015..c7379728 100644 --- a/app/src/main/java/me/teble/xposed/autodaily/ui/MainLayout.kt +++ b/app/src/main/java/me/teble/xposed/autodaily/ui/MainLayout.kt @@ -45,10 +45,11 @@ import me.teble.xposed.autodaily.task.util.ConfigUtil.getCurrentExecTaskNum import me.teble.xposed.autodaily.task.util.Const.GLOBAL_ENABLE import me.teble.xposed.autodaily.ui.Cache.currConf import me.teble.xposed.autodaily.ui.XAutoDailyApp.Main -import me.teble.xposed.autodaily.ui.XAutoDailyApp.Setting +import me.teble.xposed.autodaily.ui.XAutoDailyApp.Other import me.teble.xposed.autodaily.ui.XAutoDailyApp.Sign import me.teble.xposed.autodaily.ui.utils.RippleCustomTheme import me.teble.xposed.autodaily.utils.openUrl +import java.util.concurrent.CompletableFuture.runAsync import kotlin.concurrent.thread @Composable @@ -131,10 +132,10 @@ fun MainLayout(navController: NavHostController) { } item { LineButton( - title = "模块设置", - desc = "模块相关的功能配置", + title = "其它", + desc = "模块配置、日志及备份", onClick = { - navController.navigate(Setting) { + navController.navigate(Other) { popUpTo(Main) } }, @@ -321,16 +322,17 @@ fun BackgroundView() { ) ) ) { - Button( onClick = { - val currentTime = System.currentTimeMillis() - if (currentTime - lastClickTime < 5000) { - ToastUtil.send("点那么快怎么不上天呢") - return@Button + runAsync { + val currentTime = System.currentTimeMillis() + if (currentTime - lastClickTime < 5000) { + ToastUtil.send("点那么快怎么不上天呢") + return@runAsync + } + lastClickTime = currentTime + handler.sendEmptyMessage(EXEC_TASK) } - lastClickTime = currentTime - handler.sendEmptyMessage(EXEC_TASK) }, shape = RoundedCornerShape(25.dp), colors = ButtonDefaults.textButtonColors(backgroundColor = Color.White), diff --git a/app/src/main/java/me/teble/xposed/autodaily/ui/SettingLayout.kt b/app/src/main/java/me/teble/xposed/autodaily/ui/OtherLayout.kt similarity index 95% rename from app/src/main/java/me/teble/xposed/autodaily/ui/SettingLayout.kt rename to app/src/main/java/me/teble/xposed/autodaily/ui/OtherLayout.kt index 91d5d8e1..fd3a7fc5 100644 --- a/app/src/main/java/me/teble/xposed/autodaily/ui/SettingLayout.kt +++ b/app/src/main/java/me/teble/xposed/autodaily/ui/OtherLayout.kt @@ -30,7 +30,7 @@ import kotlin.system.exitProcess @Composable -fun SettingLayout(navController: NavHostController) { +fun OtherLayout(navController: NavHostController) { var fileUri by remember { mutableStateOf(null) } val restoreLauncher = rememberLauncherForActivityResult(ActivityResultContracts.GetContent()) { uri: Uri? -> @@ -103,7 +103,7 @@ fun SettingLayout(navController: NavHostController) { } } } - ActivityView(title = "插件设置") { + ActivityView(title = "其它") { LazyColumn( modifier = Modifier .padding(top = 13.dp) @@ -120,7 +120,8 @@ fun SettingLayout(navController: NavHostController) { checked = checked, onChange = { Cache.showTaskToast = it - } + }, + modifier = Modifier.padding(vertical = 8.dp), ) } item { @@ -131,7 +132,8 @@ fun SettingLayout(navController: NavHostController) { checked = checked, onChange = { Cache.usedThreadPool = it - } + }, + modifier = Modifier.padding(vertical = 8.dp), ) } item { @@ -178,5 +180,5 @@ fun SettingLayout(navController: NavHostController) { @Preview @Composable fun PreviewSettingLayout() { - SettingLayout(rememberNavController()) + OtherLayout(rememberNavController()) } \ No newline at end of file diff --git a/app/src/main/java/me/teble/xposed/autodaily/ui/XAutoDailyApp.kt b/app/src/main/java/me/teble/xposed/autodaily/ui/XAutoDailyApp.kt index 72953e88..bff9527e 100644 --- a/app/src/main/java/me/teble/xposed/autodaily/ui/XAutoDailyApp.kt +++ b/app/src/main/java/me/teble/xposed/autodaily/ui/XAutoDailyApp.kt @@ -11,13 +11,13 @@ import androidx.navigation.compose.rememberNavController import androidx.navigation.navArgument import me.teble.xposed.autodaily.ui.XAutoDailyApp.EditEnv import me.teble.xposed.autodaily.ui.XAutoDailyApp.Main -import me.teble.xposed.autodaily.ui.XAutoDailyApp.Setting +import me.teble.xposed.autodaily.ui.XAutoDailyApp.Other import me.teble.xposed.autodaily.ui.XAutoDailyApp.Sign object XAutoDailyApp { const val Main = "MainLayout" const val Sign = "SignLayout" - const val Setting = "SettingLayout" + const val Other = "OtherLayout" const val EditEnv = "EditEnvLayout" } @@ -34,8 +34,8 @@ fun XAutoDailyApp() { composable(Sign) { SignLayout(navController = navController) } - composable(Setting) { - SettingLayout(navController = navController) + composable(Other) { + OtherLayout(navController = navController) } composable( route = "$EditEnv/{groupId}/{taskId}",