mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Add factory reset button
This commit is contained in:
parent
2a74d4fa69
commit
7adf3cd0f5
4 changed files with 39 additions and 0 deletions
|
|
@ -55,6 +55,7 @@ class AdvancedSettingsFragment : ScreenFragment("Advanced Settings"), Logging {
|
|||
binding.lsSleepSwitch.isEnabled = connected && model.isESP32()
|
||||
binding.shutdownButton.isEnabled = connected && model.hasAXP()
|
||||
binding.rebootButton.isEnabled = connected
|
||||
binding.factoryResetButton.isEnabled = connected
|
||||
}
|
||||
|
||||
binding.positionBroadcastPeriodEditText.on(EditorInfo.IME_ACTION_DONE) {
|
||||
|
|
@ -130,5 +131,17 @@ class AdvancedSettingsFragment : ScreenFragment("Advanced Settings"), Logging {
|
|||
}
|
||||
.show()
|
||||
}
|
||||
|
||||
binding.factoryResetButton.setOnClickListener {
|
||||
MaterialAlertDialogBuilder(requireContext())
|
||||
.setTitle(R.string.are_you_sure_factory_reset)
|
||||
.setMessage(R.string.factory_reset_description)
|
||||
.setNeutralButton(R.string.cancel) { _, _ ->
|
||||
}
|
||||
.setPositiveButton(R.string.okay) { _, _ ->
|
||||
model.requestFactoryReset()
|
||||
}
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue