From 4aee26b48e83c718a6ed3a430f2386e06418e137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B1=B3=E5=87=9BMiRin?= <148533509+MiRinChan@users.noreply.github.com> Date: Mon, 2 Jun 2025 22:24:17 +0800 Subject: [PATCH] manager: auto restart after Display KPM Function and Hide other info (#136) --- .../com/sukisu/ultra/ui/screen/MoreSettings.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/MoreSettings.kt b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/MoreSettings.kt index efcf3180..0807337a 100644 --- a/manager/app/src/main/java/com/sukisu/ultra/ui/screen/MoreSettings.kt +++ b/manager/app/src/main/java/com/sukisu/ultra/ui/screen/MoreSettings.kt @@ -313,12 +313,28 @@ fun MoreSettingsScreen( val onHideOtherInfoChange = { newValue: Boolean -> prefs.edit { putBoolean("is_hide_other_info", newValue) } isHideOtherInfo = newValue + + val intent = Intent(context, MainActivity::class.java) + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) + context.startActivity(intent) + + if (context is Activity) { + context.finish() + } } // 更新显示KPM开关状态 val onShowKpmInfoChange = { newValue: Boolean -> prefs.edit { putBoolean("show_kpm_info", newValue) } isShowKpmInfo = newValue + + val intent = Intent(context, MainActivity::class.java) + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) + context.startActivity(intent) + + if (context is Activity) { + context.finish() + } } // 隐藏SuSFS状态开关状态