mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 03:46:00 +01:00
Focus improvements
This commit is contained in:
@@ -149,14 +149,15 @@ public class FragmentGmail extends FragmentBase {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
etName.clearFocus();
|
||||
Helper.hideKeyboard(view);
|
||||
grpError.setVisibility(View.GONE);
|
||||
|
||||
String name = etName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(name))
|
||||
throw new IllegalArgumentException(getString(R.string.title_no_name));
|
||||
|
||||
etName.clearFocus();
|
||||
Helper.hideKeyboard(view);
|
||||
|
||||
Intent intent = newChooseAccountIntent(
|
||||
null,
|
||||
null,
|
||||
@@ -272,12 +273,12 @@ public class FragmentGmail extends FragmentBase {
|
||||
}
|
||||
|
||||
private void onNoAccountSelected(int resultCode, Intent data) {
|
||||
if (resultCode == RESULT_OK) {
|
||||
AccountManager am = AccountManager.get(getContext());
|
||||
Account[] accounts = am.getAccountsByType(TYPE_GOOGLE);
|
||||
if (accounts.length == 0)
|
||||
Log.e("newChooseAccountIntent without result=" + resultCode + " data=" + data);
|
||||
AccountManager am = AccountManager.get(getContext());
|
||||
Account[] accounts = am.getAccountsByType(TYPE_GOOGLE);
|
||||
if (accounts.length == 0)
|
||||
Log.e("newChooseAccountIntent without result=" + resultCode + " data=" + data);
|
||||
|
||||
if (resultCode == RESULT_OK) {
|
||||
tvError.setText(getString(R.string.title_no_account) + " (" + accounts.length + ")");
|
||||
grpError.setVisibility(View.VISIBLE);
|
||||
} else
|
||||
|
||||
@@ -238,6 +238,10 @@ public class FragmentOAuth extends FragmentBase {
|
||||
throw new IllegalArgumentException(getString(R.string.title_email_invalid, email));
|
||||
}
|
||||
|
||||
etName.clearFocus();
|
||||
etEmail.clearFocus();
|
||||
Helper.hideKeyboard(view);
|
||||
|
||||
etName.setEnabled(false);
|
||||
etEmail.setEnabled(false);
|
||||
cbUpdate.setEnabled(false);
|
||||
|
||||
@@ -19,6 +19,8 @@ package eu.faircode.email;
|
||||
Copyright 2018-2021 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_PASSWORD;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Paint;
|
||||
@@ -53,8 +55,6 @@ import java.util.List;
|
||||
|
||||
import javax.mail.AuthenticationFailedException;
|
||||
|
||||
import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_PASSWORD;
|
||||
|
||||
public class FragmentQuickSetup extends FragmentBase {
|
||||
private ViewGroup view;
|
||||
private ScrollView scroll;
|
||||
@@ -470,6 +470,10 @@ public class FragmentQuickSetup extends FragmentBase {
|
||||
setManual(true);
|
||||
EmailProvider provider = args.getParcelable("provider");
|
||||
|
||||
etName.clearFocus();
|
||||
etEmail.clearFocus();
|
||||
Helper.hideKeyboard(view);
|
||||
|
||||
if (ex instanceof AuthenticationFailedException) {
|
||||
String message = getString(R.string.title_setup_no_auth_hint);
|
||||
if (provider != null && provider.appPassword)
|
||||
|
||||
Reference in New Issue
Block a user