mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
chore(settings): Add "danger zone" category
This commit is contained in:
parent
d163dc500c
commit
b1f2c30892
1 changed files with 29 additions and 23 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue