Browse Source

Disable domain name on auto config

main
M66B 6 years ago
parent
commit
80a4e5ce1b
2 changed files with 6 additions and 0 deletions
  1. +3
    -0
      app/src/main/java/eu/faircode/email/FragmentAccount.java
  2. +3
    -0
      app/src/main/java/eu/faircode/email/FragmentIdentity.java

+ 3
- 0
app/src/main/java/eu/faircode/email/FragmentAccount.java View File

@ -231,6 +231,7 @@ public class FragmentAccount extends FragmentEx {
btnAutoConfig.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etDomain.setEnabled(false);
btnAutoConfig.setEnabled(false);
Bundle args = new Bundle();
@ -253,6 +254,7 @@ public class FragmentAccount extends FragmentEx {
@Override
protected void onLoaded(Bundle args, SRVRecord srv) {
etDomain.setEnabled(true);
btnAutoConfig.setEnabled(true);
if (srv != null) {
etHost.setText(srv.getTarget().toString(true));
@ -262,6 +264,7 @@ public class FragmentAccount extends FragmentEx {
@Override
protected void onException(Bundle args, Throwable ex) {
etDomain.setEnabled(true);
btnAutoConfig.setEnabled(true);
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();


+ 3
- 0
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -218,6 +218,7 @@ public class FragmentIdentity extends FragmentEx {
btnAutoConfig.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etDomain.setEnabled(false);
btnAutoConfig.setEnabled(false);
Bundle args = new Bundle();
@ -240,6 +241,7 @@ public class FragmentIdentity extends FragmentEx {
@Override
protected void onLoaded(Bundle args, SRVRecord srv) {
etDomain.setEnabled(true);
btnAutoConfig.setEnabled(true);
if (srv != null) {
etHost.setText(srv.getTarget().toString(true));
@ -250,6 +252,7 @@ public class FragmentIdentity extends FragmentEx {
@Override
protected void onException(Bundle args, Throwable ex) {
etDomain.setEnabled(true);
btnAutoConfig.setEnabled(true);
if (ex instanceof IllegalArgumentException)
Snackbar.make(view, ex.getMessage(), Snackbar.LENGTH_LONG).show();


Loading…
Cancel
Save