From b1f2c30892d0ceb99bdda01ebe9448f0053538a7 Mon Sep 17 00:00:00 2001 From: Ahmad Ansori Palembani Date: Thu, 21 Nov 2024 10:28:29 +0700 Subject: [PATCH] chore(settings): Add "danger zone" category --- .../controllers/SettingsAdvancedController.kt | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/controllers/SettingsAdvancedController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/controllers/SettingsAdvancedController.kt index fa4f473ac8..b32233654f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/controllers/SettingsAdvancedController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/controllers/SettingsAdvancedController.kt @@ -426,30 +426,36 @@ class SettingsAdvancedController : SettingsLegacyController() { } } - preference { - title = "Crash the app!" - summary = "To test crashes" - onClick { - activity!!.materialAlertDialog() - .setTitle(MR.strings.warning) - .setMessage("I told you this would crash the app, why would you want that?") - .setPositiveButton("Crash it anyway") { _, _ -> throw RuntimeException("Fell into the void") } - .setNegativeButton("Nevermind", null) - .show() - } - } + preferenceCategory { + title = "Danger zone!" - preference { - title = "Prune finished workers" - summary = "In case worker stuck in FAILED state and you're too impatient to wait" - onClick { - activity!!.materialAlertDialog() - .setTitle("Are you sure?") - .setMessage("Failed workers should clear out by itself eventually, " + - "this option should only be used if you're being impatient and you know what you're doing.") - .setPositiveButton("Prune") { _, _ -> context.workManager.pruneWork() } - .setNegativeButton("Cancel", null) - .show() + preference { + title = "Crash the app!" + summary = "To test crashes" + onClick { + activity!!.materialAlertDialog() + .setTitle(MR.strings.warning) + .setMessage("I told you this would crash the app, why would you want that?") + .setPositiveButton("Crash it anyway") { _, _ -> throw RuntimeException("Fell into the void") } + .setNegativeButton("Nevermind", null) + .show() + } + } + + preference { + title = "Prune finished workers" + summary = "In case worker stuck in FAILED state and you're too impatient to wait" + onClick { + activity!!.materialAlertDialog() + .setTitle("Are you sure?") + .setMessage( + "Failed workers should clear out by itself eventually, " + + "this option should only be used if you're being impatient and you know what you're doing." + ) + .setPositiveButton("Prune") { _, _ -> context.workManager.pruneWork() } + .setNegativeButton("Cancel", null) + .show() + } } } }