From 58d846b5ea12a2c337b1febed2cf4a9acfd8fd19 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 2 Jan 2019 10:59:57 +0100 Subject: [PATCH] Disable saving on selecting account --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 8 ++++++++ app/src/main/java/eu/faircode/email/FragmentSetup.java | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 219c7fd18c..008b8bde74 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -1139,6 +1139,10 @@ public class FragmentAccount extends FragmentEx { for (final Account account : accounts) if (name.equals(account.name)) { btnAuthorize.setEnabled(false); + etUser.setEnabled(false); + tilPassword.setEnabled(false); + btnCheck.setEnabled(false); + btnSave.setEnabled(false); final Snackbar snackbar = Snackbar.make(view, R.string.title_authorizing, Snackbar.LENGTH_SHORT); snackbar.show(); @@ -1163,6 +1167,10 @@ public class FragmentAccount extends FragmentEx { Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex); } finally { btnAuthorize.setEnabled(true); + etUser.setEnabled(true); + tilPassword.setEnabled(true); + btnCheck.setEnabled(true); + btnSave.setEnabled(true); new Handler().postDelayed(new Runnable() { @Override public void run() { diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index 584dc97bff..da12ee30d1 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -855,6 +855,9 @@ public class FragmentSetup extends FragmentEx { for (final Account account : accounts) if (name.equals(account.name)) { btnAuthorize.setEnabled(false); + etEmail.setEnabled(false); + tilPassword.setEnabled(false); + btnQuick.setEnabled(false); final Snackbar snackbar = Snackbar.make(view, R.string.title_authorizing, Snackbar.LENGTH_SHORT); snackbar.show(); @@ -879,6 +882,9 @@ public class FragmentSetup extends FragmentEx { Helper.unexpectedError(getContext(), getViewLifecycleOwner(), ex); } finally { btnAuthorize.setEnabled(true); + etEmail.setEnabled(true); + tilPassword.setEnabled(true); + btnQuick.setEnabled(true); new Handler().postDelayed(new Runnable() { @Override public void run() {