Commit bd967505 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Shows the logout dialog before logging out.

parent f11ddfd4
...@@ -89,7 +89,7 @@ class SettingsFragment : Fragment(), SettingsView { ...@@ -89,7 +89,7 @@ class SettingsFragment : Fragment(), SettingsView {
text_server_version.text = getString(R.string.msg_server_version, serverVersion) text_server_version.text = getString(R.string.msg_server_version, serverVersion)
text_logout.setOnClickListener { presenter.logout() } text_logout.setOnClickListener { showLogoutDialog()}
with(text_administration) { with(text_administration) {
isVisible = isAdministrationEnabled isVisible = isAdministrationEnabled
...@@ -173,6 +173,17 @@ class SettingsFragment : Fragment(), SettingsView { ...@@ -173,6 +173,17 @@ class SettingsFragment : Fragment(), SettingsView {
} }
} }
private fun showLogoutDialog() {
context?.let {
val builder = AlertDialog.Builder(it)
builder.setTitle(R.string.title_are_you_sure)
.setPositiveButton(R.string.action_logout) { _, _ -> presenter.logout()}
.setNegativeButton(android.R.string.no) { dialog, _ -> dialog.cancel() }
.create()
.show()
}
}
private fun showDeleteAccountDialog() { private fun showDeleteAccountDialog() {
context?.let { context?.let {
AlertDialog.Builder(it) AlertDialog.Builder(it)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment