Added remark about Gmail setup

This commit is contained in:
M66B 2020-02-28 17:18:23 +01:00
parent ffc262d3ed
commit ec7df34e07
3 changed files with 22 additions and 1 deletions

View File

@ -74,6 +74,8 @@ import java.util.Objects;
import javax.mail.Folder; import javax.mail.Folder;
import static android.app.Activity.RESULT_OK; 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_NONE;
import static com.google.android.material.textfield.TextInputLayout.END_ICON_PASSWORD_TOGGLE; 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 ScrollView scroll;
private Spinner spProvider; private Spinner spProvider;
private TextView tvGmailHint;
private EditText etDomain; private EditText etDomain;
private Button btnAutoConfig; private Button btnAutoConfig;
@ -193,6 +196,7 @@ public class FragmentAccount extends FragmentBase {
// Get controls // Get controls
spProvider = view.findViewById(R.id.spProvider); spProvider = view.findViewById(R.id.spProvider);
tvGmailHint = view.findViewById(R.id.tvGmailHint);
etDomain = view.findViewById(R.id.etDomain); etDomain = view.findViewById(R.id.etDomain);
btnAutoConfig = view.findViewById(R.id.btnAutoConfig); btnAutoConfig = view.findViewById(R.id.btnAutoConfig);
@ -267,6 +271,9 @@ public class FragmentAccount extends FragmentBase {
@Override @Override
public void onItemSelected(AdapterView<?> adapterView, View view, int position, long itemid) { public void onItemSelected(AdapterView<?> adapterView, View view, int position, long itemid) {
EmailProvider provider = (EmailProvider) adapterView.getSelectedItem(); 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); grpServer.setVisibility(position > 0 ? View.VISIBLE : View.GONE);
grpAuthorize.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 // Initialize
Helper.setViewsEnabled(view, false); Helper.setViewsEnabled(view, false);
tvGmailHint.setVisibility(GONE);
btnAutoConfig.setEnabled(false); btnAutoConfig.setEnabled(false);
pbAutoConfig.setVisibility(View.GONE); pbAutoConfig.setVisibility(View.GONE);

View File

@ -32,6 +32,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvProvider" /> app:layout_constraintTop_toBottomOf="@id/tvProvider" />
<TextView
android:id="@+id/tvGmailHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:text="@string/title_account_gmail"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spProvider" />
<!-- auto config --> <!-- auto config -->
<TextView <TextView
@ -42,7 +53,7 @@
android:text="@string/title_domain" android:text="@string/title_domain"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spProvider" /> app:layout_constraintTop_toBottomOf="@id/tvGmailHint" />
<TextView <TextView
android:id="@+id/tvDomainHint" android:id="@+id/tvDomainHint"

View File

@ -509,6 +509,7 @@
<string name="title_account_left">Swipe left</string> <string name="title_account_left">Swipe left</string>
<string name="title_account_right">Swipe right</string> <string name="title_account_right">Swipe right</string>
<string name="title_account_move">Default move to</string> <string name="title_account_move">Default move to</string>
<string name="title_account_gmail">For reliable synchronisation of a Gmail account, the Gmail quick setup wizard should be used whenever possible</string>
<string name="title_domain">Domain name</string> <string name="title_domain">Domain name</string>
<string name="title_autoconfig">Get settings</string> <string name="title_autoconfig">Get settings</string>
<string name="title_imap" translatable="false">IMAP</string> <string name="title_imap" translatable="false">IMAP</string>