Added OAuth help

pull/206/head
M66B 3 years ago
parent a6f9f34480
commit bf9c2124e0

@ -1001,11 +1001,13 @@ The easiest way is to use the menu item *Fetch more messages* in the three-dots
An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting *Outlook/Office 365*. An Outlook / Live / Hotmail account can be set up via the quick setup wizard and selecting *Outlook/Office 365*.
To use an Outlook, Live or Hotmail account with two factor authentication enabled, you need to create an app password. To use an Outlook, Live or Hotmail account with two factor authentication enabled, you might need to create an app password.
See [here](https://support.microsoft.com/en-us/help/12409/microsoft-account-app-passwords-two-step-verification) for the details. See [here](https://support.microsoft.com/en-us/help/12409/microsoft-account-app-passwords-two-step-verification) for the details.
See [here](https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040) for Microsoft's instructions. See [here](https://support.office.com/en-us/article/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040) for Microsoft's instructions.
Please see [this FAQ](#user-content-faq139) for possible causes of the error *... User is authenticated but not connected ...*.
For setting up an Office 365 account, please see [this FAQ](#user-content-faq156). For setting up an Office 365 account, please see [this FAQ](#user-content-faq156).
<br /> <br />

@ -118,6 +118,7 @@ public class FragmentOAuth extends FragmentBase {
private TextView tvGmailDraftsHint; private TextView tvGmailDraftsHint;
private TextView tvOfficeAuthHint; private TextView tvOfficeAuthHint;
private Button btnSupport; private Button btnSupport;
private Button btnHelp;
private Group grpError; private Group grpError;
@ -162,6 +163,7 @@ public class FragmentOAuth extends FragmentBase {
tvGmailDraftsHint = view.findViewById(R.id.tvGmailDraftsHint); tvGmailDraftsHint = view.findViewById(R.id.tvGmailDraftsHint);
tvOfficeAuthHint = view.findViewById(R.id.tvOfficeAuthHint); tvOfficeAuthHint = view.findViewById(R.id.tvOfficeAuthHint);
btnSupport = view.findViewById(R.id.btnSupport); btnSupport = view.findViewById(R.id.btnSupport);
btnHelp = view.findViewById(R.id.btnHelp);
grpError = view.findViewById(R.id.grpError); grpError = view.findViewById(R.id.grpError);
@ -190,6 +192,18 @@ public class FragmentOAuth extends FragmentBase {
} }
}); });
btnHelp.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try {
EmailProvider provider = EmailProvider.getProvider(v.getContext(), id);
Helper.view(v.getContext(), Uri.parse(provider.link), false);
} catch (Throwable ex) {
Log.e(ex);
}
}
});
// Initialize // Initialize
tvTitle.setText(getString(R.string.title_setup_oauth_rationale, name)); tvTitle.setText(getString(R.string.title_setup_oauth_rationale, name));
etName.setVisibility(askAccount ? View.VISIBLE : View.GONE); etName.setVisibility(askAccount ? View.VISIBLE : View.GONE);
@ -933,6 +947,16 @@ public class FragmentOAuth extends FragmentBase {
tvOfficeAuthHint.setVisibility(View.VISIBLE); tvOfficeAuthHint.setVisibility(View.VISIBLE);
} }
EmailProvider provider;
try {
provider = EmailProvider.getProvider(getContext(), id);
} catch (Throwable exex) {
Log.e(exex);
provider = null;
}
btnHelp.setVisibility((provider != null && provider.link != null ? View.VISIBLE : View.GONE));
etName.setEnabled(true); etName.setEnabled(true);
etEmail.setEnabled(true); etEmail.setEnabled(true);
cbUpdate.setEnabled(true); cbUpdate.setEnabled(true);
@ -950,6 +974,7 @@ public class FragmentOAuth extends FragmentBase {
} }
private void hideError() { private void hideError() {
btnHelp.setVisibility(View.GONE);
grpError.setVisibility(View.GONE); grpError.setVisibility(View.GONE);
tvGmailDraftsHint.setVisibility(View.GONE); tvGmailDraftsHint.setVisibility(View.GONE);
tvOfficeAuthHint.setVisibility(View.GONE); tvOfficeAuthHint.setVisibility(View.GONE);

@ -181,6 +181,21 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOfficeAuthHint" /> app:layout_constraintTop_toBottomOf="@id/tvOfficeAuthHint" />
<Button
android:id="@+id/btnHelp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:backgroundTint="?attr/colorInfoBackground"
android:drawableEnd="@drawable/twotone_help_24"
android:drawablePadding="6dp"
android:drawableTint="?attr/colorInfoForeground"
android:text="@string/title_setup_help"
android:textColor="?attr/colorInfoForeground"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvOfficeAuthHint" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpError" android:id="@+id/grpError"
android:layout_width="0dp" android:layout_width="0dp"

Loading…
Cancel
Save