mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
76cf2d5723
commit
0571cc07a1
|
@ -177,6 +177,10 @@ public class EntityAccount extends EntityOrder implements Serializable {
|
|||
return "outlook.office365.com".equalsIgnoreCase(host);
|
||||
}
|
||||
|
||||
static boolean isOutlook(String id) {
|
||||
return ("office365".equals(id) || "outlook".equals(id));
|
||||
}
|
||||
|
||||
boolean isYahooJp() {
|
||||
return "imap.mail.yahoo.co.jp".equalsIgnoreCase(host);
|
||||
}
|
||||
|
|
|
@ -319,9 +319,8 @@ public class FragmentAccount extends FragmentBase {
|
|||
etUser.setTag(null);
|
||||
etUser.setText(null);
|
||||
tilPassword.getEditText().setText(null);
|
||||
tvAppPassword.setVisibility(
|
||||
"office365".equals(provider.id) || "outlook".equals(provider.id)
|
||||
? View.VISIBLE : View.GONE);
|
||||
tvAppPassword.setVisibility(EntityAccount.isOutlook(provider.id)
|
||||
? View.VISIBLE : View.GONE);
|
||||
certificate = null;
|
||||
tvCertificate.setText(R.string.title_optional);
|
||||
etRealm.setText(null);
|
||||
|
@ -1606,8 +1605,7 @@ public class FragmentAccount extends FragmentBase {
|
|||
|
||||
etUser.setText(account == null ? null : account.user);
|
||||
tilPassword.getEditText().setText(account == null ? null : account.password);
|
||||
tvAppPassword.setVisibility(account != null &&
|
||||
("office365".equals(account.provider) || "outlook".equals(account.provider))
|
||||
tvAppPassword.setVisibility(account != null && EntityAccount.isOutlook(account.provider)
|
||||
? View.VISIBLE : View.GONE);
|
||||
certificate = (account == null ? null : account.certificate_alias);
|
||||
tvCertificate.setText(certificate == null ? getString(R.string.title_optional) : certificate);
|
||||
|
|
|
@ -1006,7 +1006,7 @@ public class FragmentOAuth extends FragmentBase {
|
|||
|
||||
grpError.setVisibility(View.VISIBLE);
|
||||
|
||||
if ("office365".equals(id) || "outlook".equals(id)) {
|
||||
if (EntityAccount.isOutlook(id)) {
|
||||
if (ex instanceof AuthenticationFailedException)
|
||||
tvOfficeAuthHint.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue