|
|
@ -5907,6 +5907,7 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
final Context context = getContext();
|
|
|
|
final Context context = getContext();
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
long outlook_last_checked = prefs.getLong("outlook_last_checked", 0);
|
|
|
|
long outlook_last_checked = prefs.getLong("outlook_last_checked", 0);
|
|
|
|
|
|
|
|
boolean outlook_checked = prefs.getBoolean("outlook_checked", false);
|
|
|
|
|
|
|
|
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
|
cal.set(Calendar.MILLISECOND, 0);
|
|
|
|
cal.set(Calendar.MILLISECOND, 0);
|
|
|
@ -5944,29 +5945,43 @@ public class FragmentMessages extends FragmentBase
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void onExecuted(Bundle args, List<EntityAccount> accounts) {
|
|
|
|
protected void onExecuted(Bundle args, List<EntityAccount> accounts) {
|
|
|
|
|
|
|
|
int oauth = 0;
|
|
|
|
int passwd = 0;
|
|
|
|
int passwd = 0;
|
|
|
|
if (accounts != null)
|
|
|
|
if (accounts != null)
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
for (EntityAccount account : accounts)
|
|
|
|
if (account.isOutlook() &&
|
|
|
|
if (account.isOutlook())
|
|
|
|
account.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD)
|
|
|
|
if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_OAUTH)
|
|
|
|
|
|
|
|
oauth++;
|
|
|
|
|
|
|
|
else if (account.auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD)
|
|
|
|
passwd++;
|
|
|
|
passwd++;
|
|
|
|
|
|
|
|
|
|
|
|
if (passwd == 0)
|
|
|
|
if (oauth + passwd == 0)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (oauth > 0 && passwd == 0 && outlook_checked)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, R.string.title_check_outlook_password, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
boolean checked = (passwd == 0);
|
|
|
|
|
|
|
|
int resid = (checked ? R.string.title_check_outlook_oauth : R.string.title_check_outlook_password);
|
|
|
|
|
|
|
|
final Snackbar snackbar = Helper.setSnackbarOptions(Snackbar.make(view, resid, Snackbar.LENGTH_INDEFINITE));
|
|
|
|
Helper.setSnackbarLines(snackbar, 5);
|
|
|
|
Helper.setSnackbarLines(snackbar, 5);
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
snackbar.setAction(R.string.title_info, new View.OnClickListener() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onClick(View v) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
snackbar.dismiss();
|
|
|
|
snackbar.dismiss();
|
|
|
|
Helper.viewFAQ(v.getContext(), 14);
|
|
|
|
if (checked)
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("outlook_checked", true).apply();
|
|
|
|
|
|
|
|
else
|
|
|
|
prefs.edit().putLong("outlook_last_checked", now).apply();
|
|
|
|
prefs.edit().putLong("outlook_last_checked", now).apply();
|
|
|
|
|
|
|
|
Helper.viewFAQ(v.getContext(), 14);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
snackbar.addCallback(new Snackbar.Callback() {
|
|
|
|
snackbar.addCallback(new Snackbar.Callback() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onDismissed(Snackbar transientBottomBar, int event) {
|
|
|
|
public void onDismissed(Snackbar transientBottomBar, int event) {
|
|
|
|
|
|
|
|
if (checked)
|
|
|
|
|
|
|
|
prefs.edit().putBoolean("outlook_checked", true).apply();
|
|
|
|
|
|
|
|
else
|
|
|
|
prefs.edit().putLong("outlook_last_checked", now).apply();
|
|
|
|
prefs.edit().putLong("outlook_last_checked", now).apply();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|