From ec7df34e07c605faa6460a30543c565b6f984816 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 28 Feb 2020 17:18:23 +0100 Subject: [PATCH] Added remark about Gmail setup --- .../java/eu/faircode/email/FragmentAccount.java | 9 +++++++++ app/src/main/res/layout/fragment_account.xml | 13 ++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index dbeb784dd8..ba6feeb5c9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -74,6 +74,8 @@ import java.util.Objects; import javax.mail.Folder; import static android.app.Activity.RESULT_OK; +import static android.view.View.GONE; +import static android.view.View.VISIBLE; import static com.google.android.material.textfield.TextInputLayout.END_ICON_NONE; import static com.google.android.material.textfield.TextInputLayout.END_ICON_PASSWORD_TOGGLE; @@ -82,6 +84,7 @@ public class FragmentAccount extends FragmentBase { private ScrollView scroll; private Spinner spProvider; + private TextView tvGmailHint; private EditText etDomain; private Button btnAutoConfig; @@ -193,6 +196,7 @@ public class FragmentAccount extends FragmentBase { // Get controls spProvider = view.findViewById(R.id.spProvider); + tvGmailHint = view.findViewById(R.id.tvGmailHint); etDomain = view.findViewById(R.id.etDomain); btnAutoConfig = view.findViewById(R.id.btnAutoConfig); @@ -267,6 +271,9 @@ public class FragmentAccount extends FragmentBase { @Override public void onItemSelected(AdapterView adapterView, View view, int position, long itemid) { EmailProvider provider = (EmailProvider) adapterView.getSelectedItem(); + tvGmailHint.setVisibility( + auth == EmailService.AUTH_TYPE_PASSWORD && "gmail".equals(provider.id) + ? VISIBLE : GONE); grpServer.setVisibility(position > 0 ? View.VISIBLE : View.GONE); grpAuthorize.setVisibility(position > 0 ? View.VISIBLE : View.GONE); @@ -492,6 +499,8 @@ public class FragmentAccount extends FragmentBase { // Initialize Helper.setViewsEnabled(view, false); + tvGmailHint.setVisibility(GONE); + btnAutoConfig.setEnabled(false); pbAutoConfig.setVisibility(View.GONE); diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index db5e8ee5e7..fe1e2188f4 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -32,6 +32,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvProvider" /> + + + app:layout_constraintTop_toBottomOf="@id/tvGmailHint" /> Swipe left Swipe right Default move to + For reliable synchronisation of a Gmail account, the Gmail quick setup wizard should be used whenever possible Domain name Get settings IMAP