mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 00:53:26 +02:00
Added OAuth help
This commit is contained in:
@@ -118,6 +118,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
private TextView tvGmailDraftsHint;
|
||||
private TextView tvOfficeAuthHint;
|
||||
private Button btnSupport;
|
||||
private Button btnHelp;
|
||||
|
||||
private Group grpError;
|
||||
|
||||
@@ -162,6 +163,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
tvGmailDraftsHint = view.findViewById(R.id.tvGmailDraftsHint);
|
||||
tvOfficeAuthHint = view.findViewById(R.id.tvOfficeAuthHint);
|
||||
btnSupport = view.findViewById(R.id.btnSupport);
|
||||
btnHelp = view.findViewById(R.id.btnHelp);
|
||||
|
||||
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
|
||||
tvTitle.setText(getString(R.string.title_setup_oauth_rationale, name));
|
||||
etName.setVisibility(askAccount ? View.VISIBLE : View.GONE);
|
||||
@@ -933,6 +947,16 @@ public class FragmentOAuth extends FragmentBase {
|
||||
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);
|
||||
etEmail.setEnabled(true);
|
||||
cbUpdate.setEnabled(true);
|
||||
@@ -950,6 +974,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||
}
|
||||
|
||||
private void hideError() {
|
||||
btnHelp.setVisibility(View.GONE);
|
||||
grpError.setVisibility(View.GONE);
|
||||
tvGmailDraftsHint.setVisibility(View.GONE);
|
||||
tvOfficeAuthHint.setVisibility(View.GONE);
|
||||
|
||||
Reference in New Issue
Block a user